{% extends 'base/base.html' %}
{% load static %}
{% load humanize %}
{% load custom_tags %}
{% load mathfilters %}
{% block title %}
Detailed Scan
{% endblock title %}

{% block custom_js_css_link %}
<link href="{% static 'plugins/select2/select2.min.css' %}" rel="stylesheet" type="text/css" />
<link href="{% static 'plugins/perfect-scrollbar/perfect-scrollbar.css' %}" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{% static 'plugins/gridzy/gridzy.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'plugins/gridzy/skins/gridzySkinBlank/style.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'plugins/j-map/jquery-jvectormap.css' %}">
<link href="{% static 'plugins/lightbox/css/lightbox.css' %}" rel="stylesheet" />
<script src="{% static 'plugins/gridzy/gridzy.js' %}"></script>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="https://cdn.rawgit.com/eligrey/canvas-toBlob.js/f1a01896135ab378aa5c0118eadd81da55e698d8/canvas-toBlob.js"></script>
<script src="https://cdn.rawgit.com/eligrey/FileSaver.js/e9d941381475b5df8b7d7691013401e171014e89/FileSaver.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/6.6.3/css/flag-icons.min.css" integrity="sha512-uvXdJud8WaOlQFjlz9B15Yy2Au/bMAvz79F7Xa6OakCl2jvQPdHD0hb3dEqZRdSwG4/sknePXlE7GiarwA/9Wg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
{% endblock custom_js_css_link %}

{% block breadcrumb_title %}
<li class="breadcrumb-item"><a href="{% url 'scan_history' current_project.slug %}">Scan History</a></li>
<li class="breadcrumb-item active">Summary</li>
<li class="breadcrumb-item active" aria-current="page">{{history.domain.name}}</li>
{% endblock breadcrumb_title %}

{% block page_title %}
Scan Findings
{% endblock page_title %}

{% block main_content %}
<span aria-current="page" style="display: none">{{history.domain.name}}</span>
<div class="row">
	<div class="col-12">
		<div class="card">
			<ul class="nav nav-tabs nav-bordered m-1">
				<li class="nav-item">
					<a class="nav-link active" id="pills-summary-tab" data-bs-toggle="tab" aria-expanded="false" class="nav-link" href="#summary-tab">Home</a>
				</li>
				<li class="nav-item">
					<a class="nav-link" id="pills-subdomain-tab" data-bs-toggle="tab" aria-expanded="false" class="nav-link" href="#subdomain-tab">Subdomains</a>
				</li>
				{% if history.buckets.all %}
				<li class="nav-item">
					<a class="nav-link" id="pills-buckets-tab" data-bs-toggle="tab" aria-expanded="false" class="nav-link" href="#buckets-tab">S3 Buckets</a>
				</li>
				{% endif %}
				<li class="nav-item interesting-tab-show" style="display: none">
					<a class="nav-link" data-bs-toggle="tab" aria-expanded="false" class="nav-link" href="#interesting-tab">Interesting Recon</a>
				</li>
				<li class="nav-item recon-changes-tab-show" style="display: none">
					<a class="nav-link" data-bs-toggle="tab" aria-expanded="false" class="nav-link" href="#recon-changes-tab">Recon Data Changes</a>
				</li>
				{% if 'screenshot' in history.tasks %}
				<li class="nav-item">
					<a class="nav-link" id="pills-screenshot-tab" data-bs-toggle="tab" aria-expanded="false" class="nav-link" href="#screenshot-tab">Screenshots</a>
				</li>
				{% endif %}
				{% if 'dir_file_fuzz' in history.tasks %}
				<li class="nav-item">
					<a class="nav-link" id="pills-directories-tab" data-bs-toggle="tab" aria-expanded="false" href="#directories-tab">Directories</a>
				</li>
				{% endif %}
				<li class="nav-item dropdown">
					<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">URLs&nbsp;<i class="fe-chevron-down"></i></a>
					<ul class="dropdown-menu" style="width: 240px;">
						<li><a class="dropdown-item" id="pills-endpoints-tab" href="#endpoints-tab" data-bs-toggle="tab" aria-expanded="false">All Endpoints</a></li>
						{% if 'fetch_url' in history.tasks and history.used_gf_patterns %}
						{% for key,value in matched_gf_count.items %}
							{% if value > 0 %}
							<li><a class="dropdown-item" id="pills-{{key}}-tab" href="#endpoints-tab" data-bs-toggle="tab" aria-expanded="false">{{key|upper}}<span class="badge-soft-danger float-end ms-1 ps-1 pe-1">{{value}}</span></a></li>
							{% endif %}
						{% endfor %}
						{% endif %}
					</ul>
				</li>
				{% if total_vulnerability_count > 0 %}
				<li class="nav-item">
					<a class="nav-link" id="pills-vulnerabilities-tab" data-bs-toggle="tab" aria-expanded="false" class="nav-link" href="#vulnerabilities-tab">Vulnerabilities</a>
				</li>
				{% endif %}
				{% if 'osint' in history.tasks %}
				<li class="nav-item">
					<a class="nav-link" id="pills-osint-tab" data-bs-toggle="tab" aria-expanded="false" class="nav-link" href="#osint-tab">OSINT</a>
				</li>
				{% endif %}
				<li class="nav-item">
					<a class="nav-link" id="pills-visualisation-tab" data-bs-toggle="tab" aria-expanded="false" class="nav-link" href="#visualisation-tab">Visualization</a>
				</li>
			</ul>
		</div>
	</div>
</div>
<div class="tab-content no-padding-tab">
	<!-- start tab contents  -->
	<div class="tab-pane show active" id="summary-tab">
		<div class="row">
			<div class="col-xl-3 col-lg-4">
				<div class="card">
					<div class="card-body">
						<div class="d-flex align-items-start mb-3">
							<div class="w-100">
								<h5 class="mt-0 mb-0 font-15">
									Scan Status for <span class="badge badge-soft-primary">{{history.domain.name}}</span>
								</h5>
								<p class="mt-1 mb-0 text-muted font-14">
									{% if history.scan_status == -1 %}
									<span class="mdi mdi-circle text-warning"></span>
									<span class="badge badge-soft-warning">Pending</span>
									{% elif history.scan_status == 0 %}
									<span class="mdi mdi-circle text-danger"></span>
									<span class="badge badge-soft-danger">Failed</span>
									{% elif history.scan_status == 1 %}
									<span class="mdi mdi-circle text-warning"></span>
									<span class="badge badge-soft-warning">In Progress</span>
									{% elif history.scan_status == 2 %}
									<span class="mdi mdi-circle text-success"></span>
									<span class="badge badge-soft-success">Completed</span>
									{% elif history.scan_status == 3 %}
									<span class="mdi mdi-circle text-danger"></span>
									<span class="badge badge-soft-danger">Aborted</span>
									{% else %}
									<span class="mdi mdi-circle text-danger"></span>
									<span class="badge badge-danger">Unknown</span>
									{% endif %}
								</p>
							</div>
							<div class="btn-group mb-2">
								<a href="#" class="text-dark dropdown-toggle float-end" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
									<i class="fe-more-vertical"></i>
								</a>
								<div class="dropdown-menu" style="">
									<a class="dropdown-item" href="javascript:download_subdomains({{scan_history_id}}, '{{history.domain.name}}')">Download All Subdomains</a>
									<a class="dropdown-item" href="javascript:download_endpoints({{scan_history_id}}, '{{history.domain.name}}')">Download All Endpoints</a>
									<a class="dropdown-item" href="javascript:download_important_subdomains({{scan_history_id}}, '{{history.domain.name}}');">Download Important Subdomains</a>
									<a class="dropdown-item" href="javascript:download_interesting_subdomains({{scan_history_id}}, '{{history.domain.name}}');">Download Interesting Subdomains</a>
									<a class="dropdown-item" href="javascript:download_interesting_endpoints({{scan_history_id}}, '{{history.domain.name}}');">Download Interesting Endpoints</a>
								</div>
							</div>
						</div>
						{% if history.scan_status == 0 %}
						{% if history.error_message %}
							<p class="text-danger">Scan failed due to ERROR: {{history.error_message}}</p>
						{% endif %}
						{% endif %}
						<h6 class="font-13 text-muted text-uppercase"><i class="fe-settings"></i> Scan Configurations</h6>
						<span>Starting Path: {% if history.cfg_starting_point_path %} {{history.cfg_starting_point_path}} {% else %}/ {% endif %}</span><i class="fa fa-info-circle text-muted float-end" data-bs-container="#tooltip-container" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Scan path where the scan began"></i><br>
						<div class="accordion custom-accordion" id="custom-accordion-one">
							<div>
								<a class="custom-accordion-title text-reset d-block collapsed" data-bs-toggle="collapse" href="#collapseImported" aria-expanded="true" aria-controls="collapseImported">
									{{history.cfg_imported_subdomains|length}} Imported Subdomains <i class="mdi mdi-chevron-down accordion-arrow"></i>
								</a>
								<div id="collapseImported" class="collapse" data-bs-parent="#custom-accordion-one" style="">
									<ul>
										{% for subdomain in history.cfg_imported_subdomains %}
										<li><code>{{subdomain}}</code></li>
										{% endfor %}
									</ul>
								</div>
							</div>
							<div>
								<a class="custom-accordion-title text-reset d-block collapsed" data-bs-toggle="collapse" href="#collapseOutofScope" aria-expanded="true" aria-controls="collapseImported">
									{{history.cfg_out_of_scope_subdomains|length}} out of scope Subdomains <i class="mdi mdi-chevron-down accordion-arrow"></i>
								</a>
								<div id="collapseOutofScope" class="collapse" data-bs-parent="#custom-accordion-one" style="">
									<ul>
										{% for subdomain in history.cfg_out_of_scope_subdomains %}
										<li><code>{{subdomain}}</code></li>
										{% endfor %}
									</ul>
								</div>
							</div>
							<div>
								<a class="custom-accordion-title text-reset d-block collapsed" data-bs-toggle="collapse" href="#collapsePath" aria-expanded="true" aria-controls="collapseImported">
									{{history.cfg_excluded_paths|length}} Excluded Paths <i class="mdi mdi-chevron-down accordion-arrow"></i>
								</a>
								<div id="collapsePath" class="collapse" data-bs-parent="#custom-accordion-one" style="">
									<ul>
										{% for path in history.cfg_excluded_paths %}
										<li><code>{{path}}</code></li>
										{% endfor %}
									</ul>
								</div>
							</div>
						</div>
						<h6 class="font-13 text-muted text-uppercase mt-3"><i class="fe-file"></i> Scan Logs</h6>
						<span><a href="javascript:get_logs_modal({{history.id}})"><i class="fe-terminal"></i> Logs</a></span>
						<h6 class="font-13 text-muted text-uppercase mt-3"><i class="fe-cpu"></i> Scan Engine</h6>
						<span class="badge badge-soft-primary">{{history.scan_type.engine_name}}</span>
						<h6 class="font-13 text-muted text-uppercase mt-3"><i class="fe-clock"></i> Scan Duration </h6>
						{% if history.scan_status == -1 %}
						<p class="mt-1 mb-0 text-warning font-14"><small class="text-center text-muted">Scan not yet started.</small></p>
						{% elif history.scan_status == 0 %}
						<span class="mt-1 mb-0 text-danger font-14">{{ history.start_scan_date|timesince:history.stop_scan_date }}</span>
						{% elif history.scan_status == 1 %}
						<span class="mt-1 mb-0 text-primary font-14">{{ history.get_elapsed_time }}</span>
						{% elif history.scan_status == 2 %}
						{% if history.get_total_scan_time_in_sec < 60 %}
						<span class="mt-1 mb-0 text-success font-14">Completed in < 1 minutes</span>
						{% else %}
						<span class="mt-1 mb-0 text-success font-14">Completed in {{ history.start_scan_date|timesince:history.stop_scan_date }}</span>
						{% endif %}
						{% elif history.scan_status == 3 %}
						<span class="mt-1 mb-0 text-danger font-14">Aborted in {{ history.start_scan_date|timesince:history.stop_scan_date }}</span>
						{% endif %}
						<h3 class="font-13 text-muted text-uppercase mt-3"><i class="fe-loader"></i> Scan Progress</h3>
						<div class="progress mb-2 progress-md">
							{% if history.scan_status == -1 %}
							<div class="progress-bar bg-warning" role="progressbar" style="width: 10%" aria-valuemin="0" aria-valuemax="100">
							</div>
							{% elif history.scan_status == 0 %}
							<div class="progress-bar bg-danger" role="progressbar" style="width: {% widthratio history.scanactivity_set.all|length history.scan_type.get_number_of_steps|add:4  100 %}%" aria-valuemin="0" aria-valuemax="4">
							</div>
							{% elif history.scan_status == 1 %}
							<div class="progress-bar bg-primary progress-bar-striped progress-bar-animated" role="progressbar" style="width: {% widthratio history.scanactivity_set.all|length history.scan_type.get_number_of_steps|add:4  100 %}%" aria-valuemin="0" aria-valuemax="4">
							</div>
							{% elif history.scan_status == 2 %}
							<div class="progress-bar bg-success" role="progressbar" style="width: 100%" aria-valuemin="0" aria-valuemax="100">
							</div>
							{% elif history.scan_status == 3 %}
							<div class="progress-bar bg-danger" role="progressbar" style="width: {% widthratio history.scanactivity_set.all|length history.scan_type.get_number_of_steps|add:4  100 %}%" aria-valuemin="0" aria-valuemax="4">
							</div>
							{% else %}
							<div class="progress">
								<div class="progress-bar bg-danger" role="progressbar" style="width: 100%" aria-valuemin="0" aria-valuemax="100">
								</div>
							</div>
							{% endif %}
						</div>

						{% if  history.domain.get_organization %}
						<h3 class="font-13 text-muted text-uppercase mb-2">Tagged to Organization</h3>
						{% for organization in history.domain.get_organization %}
						<span class="badge badge-soft-dark m-1" data-toggle="tooltip" data-placement="top" title="Domain {{domain.name}} belongs to organization {{organization.name}}">{{ organization.name }}</span>
						{% endfor %}
						{% endif %}

						<h6 class="font-13 text-muted text-uppercase mt-4 mb-2"><i class="fe-activity"></i> Timeline</h6>
						<div data-simplebar style="max-height: 410px;" class="p-2">
							<div class="track-order-list">
								<ul class="list-unstyled">
									{% for activity in scan_activity %}
									<li class="completed">
										<h5 class="mt-0 mb-1">{{activity.title}}
											<span class="float-end badge {% if activity.status == 0 %}badge-soft-danger {% elif activity.status == 1 %}badge-soft-warning{% elif activity.status == 2 %}badge-soft-success{% endif %}">
												{% if activity.status == 0 %}Failed
												{% elif activity.status == 1 %}In progress<span class="active-dot dot"></span>
												{% elif activity.status == 2 %}Completed
												{% endif %}
											</span>
										</h5>
										<p class="text-muted">{{activity.time|naturaltime}}<br><small class="text-muted">{{activity.time}}</small> </p>
										{% if activity.status == 0 %}
											{% if activity.error_message %}
												<p class="badge badge-soft-danger">Error: {{activity.error_message}}</p>
											{% endif %}
										{% endif %}
										<span><a href="javascript:get_logs_modal(null, {{activity.id}})"><i class="fe-terminal"></i> Logs</a></span>
									</li>
									{% endfor %}
								</ul>
							</div>
						</div>
					</div>
				</div>
				<div class="card">
					<div class="card-body">
						<div class="d-flex align-items-start mb-3">
							<div class="w-100">
								<h5 class="mt-0 mb-0 font-15">
									Recent Scans for <span class="badge badge-soft-primary">{{history.domain.name}}</span>
								</h5>
								<div class="track-order-list mt-3">
									<ul class="list-unstyled">
										{% for scan in most_recent_scans %}
										<li class="completed">
											<a href="/scan/{{current_project.slug}}/detail/{{scan.id}}">
												<h5 class="mt-0 mb-1">
													{% if history.id == scan.id %}
													<span class="active-dot dot"></span>
													<span class="float-start badge badge-soft-primary ms-1 me-1">Current Scan</span>
													{% endif %}
													{{scan.scan_type.engine_name}}
													{% if scan.scan_status == -1 %}
													<span class="badge badge-soft-warning float-end">Pending</span>
													{% elif scan.scan_status == 0 %}
													<span class="badge badge-soft-danger float-end">Failed</span>
													{% elif scan.scan_status == 1 %}
													<span class="badge badge-soft-primary float-end">Scanning</span>
													{% elif scan.scan_status == 2 %}
													<span class="badge badge-soft-success float-end">Completed</span>
													{% elif scan.scan_status == 3 %}
													<span class="badge badge-soft-danger float-end">Aborted</span>
													{% else %}
													<span class="badge badge-soft-danger float-end">Unknown</span>
													{% endif %}
												</h5>
												<br>
												<p class="text-muted">{{scan.start_scan_date|naturaltime}}<br><small class="text-muted">{{scan.start_scan_date}}</small></p>
												<p class="text-primary">
													{{scan.get_subdomain_count}} Subdomains Discovered
													<span class="float-end text-dark">
														{% with next_element=most_recent_scans|next:forloop.counter0 %}
														{% if next_element.get_subdomain_count and scan.get_subdomain_count and next_element.get_subdomain_count > scan.get_subdomain_count %}
														<span class="text-danger" data-toggle="tooltip" data-placement="top" title="{{scan.get_subdomain_count|sub:next_element.get_subdomain_count|abs}} subdomains missing since last scan."><i class="fa fa-caret-down text-danger me-1"></i>{{scan.get_subdomain_count|sub:next_element.get_subdomain_count}} Subdomains</span>
														{% elif next_element.get_subdomain_count and scan.get_subdomain_count and next_element.get_subdomain_count < scan.get_subdomain_count %}
														<span class="text-success" data-toggle="tooltip" data-placement="top" title="{{scan.get_subdomain_count|sub:next_element.get_subdomain_count}} subdomains added since last scan."><i class="fa fa-caret-up text-success me-1"></i>{{scan.get_subdomain_count|sub:next_element.get_subdomain_count}} Subdomains</span>
														{% endif %}
														{% endwith %}
													</span>
												</p>
												{% if scan.scan_status == 0 %}
													{% if scan.error_message %}
														<p class="text-danger">ERROR: {{scan.error_message}}</p>
													{% endif %}
												{% endif %}
											</a>
										</li>
										{% endfor %}
									</ul>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="card">
					<div class="card-body">
						<div class="d-flex align-items-start mb-3">
							<div class="w-100">
								<h5 class="mt-0 mb-0 font-15">
									<span id="sub_scan_history_count"></span> Sub Scan History for <span class="badge badge-soft-primary">{{history.domain.name}}</span>
								</h5>
								<div data-simplebar style="max-height: 510px;" class="p-2">
									<div id="subscan_history_widget">
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="col-xl-9 col-lg-8">
				<div class="row">
					<div class="col-xl-3 col-lg-3 col-6">
						<div class="card" id="tooltip-container">
							<div class="card-body">
								<i class="fa fa-info-circle text-muted float-end" data-bs-container="#tooltip-container" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Total Subdomains Discovered by reNgine during this scan"></i>
								<h4 class="mt-0 font-16">Subdomains Discovered</h4>
								<h2 class="text-primary my-3 text-center"><span data-plugin="counterup">{{subdomain_count|intcomma}}</span></h2>
								<br>
								<p class="mb-0"><span class="badge badge-soft-success">Alive Subdomains: {{alive_count}}</span></p>
							</div>
						</div>
					</div>

					<div class="col-xl-3 col-lg-3 col-6">
						<div class="card" id="tooltip-container1">
							<div class="card-body">
								<i class="fa fa-info-circle text-muted float-end" data-bs-container="#tooltip-container1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Total Endpoints discovered by reNgine during this scan. This includes any URLs discovered."></i>
								<h4 class="mt-0 font-16">Endpoints Discovered</h4>
								<h2 class="text-primary my-3 text-center"><span data-plugin="counterup">{{endpoint_count|intcomma}}</span></h2>
								<br>
								<p class="text-success mb-0"><span class="badge badge-soft-success">Alive Endpoints: {{endpoint_alive_count}}</span></p>
							</div>
						</div>
					</div>

					<div class="col-xl-3 col-lg-3 col-6">
						<div class="card" id="tooltip-container2">
							<div class="card-body">
								<i class="fa fa-info-circle text-muted float-end" data-bs-container="#tooltip-container2" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Total Vulnerabilities discovered by reNgine. This will be populated only if vulnerability scan is performed during this scan."></i>
								<h4 class="mt-0 font-16">Vulnerabilities Discovered</h4>
								<h2 class="text-danger my-3 text-center"><span data-plugin="counterup">{{total_vulnerability_count|intcomma}}</span></h2>
								{% if total_vulnerability_count > 0 %}
								<p class="text-muted mb-0">
									<span class="w-title text-danger">{{critical_count}} Critical, {{high_count}} High, {{medium_count}} Medium</span>
									<br>
									<span class="w-title text-primary">{{low_count}} Low, {{info_count}} Info, and {{unknown_count}} Unknown Vulnerabilities</span>
								</p>
								{% else %}
								<p class="text-muted mb-0 small">No vulnerabilities found.</p>
								<br>
								{% endif %}
							</div>
						</div>
					</div>

					<div class="col-xl-3 col-lg-3 col-6">
						<div class="card" id="tooltip-container3">
							<div class="card-body">
								<i class="fa fa-info-circle text-muted float-end" data-bs-container="#tooltip-container3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="OSINT Results"></i>
								<h4 class="mt-0 font-16">OSINT</h4>
								{% if 'osint' in history.tasks %}
								<h5 class="text-warning">{{exposed_count}} Exposed Credentials</h5>
								<p class="text-muted mb-0">{{email_count}} Email Address Discovered</p>
								<p class="text-muted mb-0">{{employees_count}} Employees Found</p>
								<br>
								{% else %}
								<h5 class="text-warning">&nbsp;</h5>
								<p class="text-muted mb-0">OSINT hasn't been performed.</p>
								<p class="text-muted mb-0">&nbsp;</p>
								<br>
								<br>
								{% endif %}
							</div>
						</div>
					</div>
					<div class="col-6 interesting-tab-show" style="display: none">
						<div class="alert alert-warning alert-dismissible fade show" role="alert">
							<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
							<i class="mdi mdi-fire-alert me-2"></i> reNgine identified <span id="interesting_subdomain_alert_count"></span> <span id="interesting_endpoint_alert_count"></span> <a class="" id="interesting-tab-btn" href="#">Check it out!</a>
						</div>
					</div>
					<div class="col-6 recon-changes-tab-show" style="display: none">
						<div class="alert alert-warning alert-dismissible fade show" role="alert">
							<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
							<i class="fe-trending-up me-2"></i> <span id="subdomain_changes_alert"></span> <a class="alert-link" id="recon-changes-tab-btn" href="#">Check it out!</a>
						</div>
					</div>
					{% if history.domain.domain_info.related_domains.all %}
					<div class="col-6 related-domains-tab-show">
						<div class="alert alert-warning alert-dismissible fade show" role="alert">
							<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
							<i class="fe-trending-up me-2"></i> reNgine identified {{history.domain.domain_info.related_domains.count}} domains related to {{history.domain}}. <a href="#" onclick="$('#v-pills-tab a:last').prev().tab('show');">Check it out!</a>
						</div>
					</div>
					{% endif %}
					{% if history.buckets.all %}
					<div class="col-6 related-domains-tab-show">
						<div class="alert alert-warning alert-dismissible fade show" role="alert">
							<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
							<i class="fe-trending-up me-2"></i> reNgine identified {{history.buckets.count}} Buckets related to {{history.domain}}. <a class="" id="buckets-tab-btn" href="#">Check it out!</a>
						</div>
					</div>
					{% endif %}
					{% if history.domain.domain_info.related_tlds.all %}
					<div class="col-6 related-domains-tab-show">
						<div class="alert alert-warning alert-dismissible fade show" role="alert">
							<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
							<i class="fe-trending-up me-2"></i>{{history.domain.name}} has {{history.domain.domain_info.related_tlds.count}} registered TLDs. <a href="#" onclick="$('#v-pills-tab a:last').tab('show');">Check it out!</a>
						</div>
					</div>
					{% endif %}
					<div class="col-xl-7 col-lg-7 col-12">
						<div class="card" style="height: 95%">
							<div class="card-body">
								<div class="card-widgets">
									<a href="javascript: fetch_whois('{{history.domain}}', true);" data-toggle="tooltip" title="Reload Whois"><i class="mdi mdi-refresh"></i></a>
								</div>
								<h4 class="header-title mb-0"><i class="fe-activity"></i>&nbsp;Target Information</h4>
								<div class="row mt-3">
									<div class="col-sm-3">
										<div class="nav flex-column nav-pills nav-pills-tab" id="v-pills-tab" role="tablist" aria-orientation="vertical">
											<a class="nav-link active show mb-1" id="v-pills-domain-tab" data-bs-toggle="pill" href="#v-pills-domain" role="tab" aria-controls="v-pills-domain-tab" aria-selected="true">Domain info</a>
											<a class="nav-link mb-1" id="v-pills-whois-tab" data-bs-toggle="pill" href="#v-pills-whois" role="tab" aria-controls="v-pills-whois" aria-selected="false">Whois</a>
											<a class="nav-link mb-1" id="v-pills-nameserver-tab" data-bs-toggle="pill" href="#v-pills-nameserver" role="tab" aria-controls="v-pills-nameserver" aria-selected="false">Nameservers</a>
											<a class="nav-link mb-1" id="v-pills-dns-tab" data-bs-toggle="pill" href="#v-pills-dns" role="tab" aria-controls="v-pills-dns" aria-selected="false">DNS Records</a>
											<a class="nav-link mb-1" id="v-pills-history-tab" data-bs-toggle="pill" href="#v-pills-history" role="tab" aria-controls="v-pills-history"aria-selected="false">Historical Ips</a>
											<a class="nav-link mb-1" id="v-pills-related-tab" data-bs-toggle="pill" href="#v-pills-related" role="tab" aria-controls="v-pills-related" aria-selected="false">
												Related Domains
												{% if history.domain.domain_info.related_domains.count %}
												<span class="badge badge-soft-primary float-end">{{history.domain.domain_info.related_domains.count}}</span>
												{% endif %}
											</a>
											<a class="nav-link mb-1" id="v-pills-similar-tab" data-bs-toggle="pill" href="#v-pills-similar" role="tab" aria-controls="v-pills-similar-tld" aria-selected="false">
												Related TLDs
												{% if history.domain.domain_info.related_tlds.count %}
												<span class="badge badge-soft-primary float-end">{{history.domain.domain_info.related_tlds.count}}</span>
												{% endif %}
											</a>
										</div>
									</div> <!-- end col-->
									<div class="col-sm-9">
										<div class="tab-content pt-0">
											<div class="tab-pane fade" id="v-pills-dns" role="tabpanel" aria-labelledby="v-pills-dns-tab" data-simplebar style="min-height: 300px;">
												<h4>A Records</h4>
												{% for dns in history.domain.domain_info.dns_records.all %}
													{% if dns.type == 'a' %}
														<span class="badge badge-soft-primary me-1 mt-1">{{ dns }}</span>
													{% endif %}
												{% endfor %}
												<h4>MX Records</h4>
												{% for dns in history.domain.domain_info.dns_records.all %}
													{% if dns.type == 'mx' %}
														<span class="badge badge-soft-primary me-1 mt-1">{{ dns }}</span>
													{% endif %}
												{% endfor %}
												<h4>TXT Records</h4>
												{% for dns in history.domain.domain_info.dns_records.all %}
													{% if dns.type == 'txt' %}
														<span class="badge badge-soft-secondary me-1 mt-1">{{ dns }}</span>
													{% endif %}
												{% endfor %}
											</div>
											<div class="tab-pane fade active show" id="v-pills-domain" role="tabpanel" aria-labelledby="v-pills-domain-tab" data-simplebar style="min-height: 300px;">
												{% if not history.domain.domain_info %}
												<div class="alert alert-danger alert-dismissible fade show" role="alert" id="whois_not_fetched_alert">
													<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
													WHOIS Record Has not been fetched, would you like to <a href="javascript: fetch_whois('{{history.domain}}', true);">fetch it now?</a>
												</div>
												{% endif %}
												<div class="alert alert-info alert-dismissible fade show" role="alert" id="whois_fetching_alert" style="display: none">
													Fetching WHOIS records, Please wait...
													<div class="spinner-border spinner-border-sm float-end" role="status"></div>
												</div>
												<div class="alert alert-success alert-dismissible fade show" role="alert" id="whois_fetched_alert" style="display: none">
													WHOIS Records have been fetched, please <a href="javascript:location.reload();">reload the page.</a>
												</div>
												<div class="row">
													<div class="col-4">
														<small class="sub-header">Domain</small>
														<h5>{{history.domain.name}}</h5>
													</div>
													<div class="col-4">
														<small class="sub-header">Dnssec</small>
														<h5>{{history.domain.domain_info.dnssec}}</h5>
													</div>
													<div class="col-4">
														<small class="sub-header">Geolocation</small>
														<h5>{{history.domain.domain_info.geolocation_iso|upper}}<span class="ms-2 fi fi-{{history.domain.domain_info.geolocation_iso|lower}}"></span></h5>
													</div>
												</div>
												<div class="row">
													<div class="col-4">
														<small class="sub-header">Created</small>
														<h5>{{history.domain.domain_info.created}}</h5>
													</div>
													<div class="col-4">
														<small class="sub-header">Updated</small>
														<h5>{{history.domain.domain_info.updated}}</h5>
													</div>
													<div class="col-4">
														<small class="sub-header">Expires</small>
														<h5>{{history.domain.domain_info.expires}}</h5>
													</div>
												</div>
												<div class="row">
													<div class="col-6">
														<small class="sub-header">Whois Server</small>
														<h5>{{history.domain.domain_info.whois_server}}</h5>
													</div>
												</div>
												<div class="row">
													<div class="col-4">
														<small class="sub-header">Registrar Name</small>
														<h5>{{history.domain.domain_info.registrar.name}}</h5>
													</div>
													<div class="col-4">
														<smal class="sub-header"l>Registrar Phone</small>
														<h5>{{history.domain.domain_info.registrar.phone}}</h5>
													</div>
													<div class="col-4">
														<small class="sub-header">Registrar Email</small>
														<h5>{{history.domain.domain_info.registrar.email}}</h5>
													</div>
												</div>
												{% for status in history.domain.domain_info.domain_statuses.all %}
													{% if 'prohibited' in status.name %}
														<span class="badge badge-soft-danger mt-1">{{status.name}}</span>
													{% else %}
														<span class="badge badge-soft-success mt-1">{{status.name}}</span>
													{% endif %}
												{% endfor %}
											</div>
											<div class="tab-pane fade" id="v-pills-whois" role="tabpanel" aria-labelledby="v-pills-whois-tab">
												<ul class="nav nav-tabs nav-bordered nav-justified">
													<li class="nav-item">
														<a href="#registrant-tab" data-bs-toggle="tab" aria-expanded="false" class="nav-link active">
															Registrant
														</a>
													</li>
													<li class="nav-item">
														<a href="#admin-tab" data-bs-toggle="tab" aria-expanded="true" class="nav-link">
															Administrative
														</a>
													</li>
													<li class="nav-item">
														<a href="#technical-tab" data-bs-toggle="tab" aria-expanded="false" class="nav-link">
															Technical
														</a>
													</li>
												</ul>
												<div class="tab-content">
													<div class="tab-pane active" id="registrant-tab">
														<div class="table-responsive">
															<table class="table mb-0">
																<tbody>
																	<tr class="table-info">
																		<td><b>ID</b></td>
																		<td><span class="fe-user"></span>&nbsp;{{history.domain.domain_info.registrant.id_str}}</td>
																	</tr>
																	<tr class="">
																		<td><b>Name</b></td>
																		<td><span class="fe-user"></span>&nbsp;{{history.domain.domain_info.registrant.name}}</td>
																	</tr>
																	<tr class="table-primary">
																		<td><b>Organization</b></td>
																		<td><span class="fe-briefcase"></span>&nbsp;{{history.domain.domain_info.registrant.organization}}</td>
																	</tr>
																	<tr class="">
																		<td><b>Email</b></td>
																		<td><span class="fe-mail"></span>&nbsp;{{history.domain.domain_info.registrant.email}}</td>
																	</tr>
																	<tr class="table-info">
																		<td><b>Phone/Fax</b></td>
																		<td>
																			{% if history.domain.domain_info.registrant.phone %}
																			<span class="fe-phone"></span>&nbsp;{{history.domain.domain_info.registrant.phone}}
																			{% endif %}
																			{% if history.domain.domain_info.registrant.fax %}
																			<span class="fe-printer"></span>&nbsp;{{history.domain.domain_info.registrant.fax}}
																		</td>
																		{% endif %}
																	</tr>
																	<tr class="">
																		<td><b>Address</b></td>
																		<td><span class="fe-home"></span>&nbsp;{{history.domain.domain_info.registrant.address}}</td>
																	</tr>
																	<tr class="table-danger">
																		<td><b>Address</b></td>
																		<td><b>City: </b>{{history.domain.domain_info.registrant.city}} <b>State: </b>{{history.domain.domain_info.registrant.state}} <b>Zip Code: </b>{{history.domain.domain_info.registrant.zip_code}} <b>Country:
																		</b>{{history.domain.domain_info.registrant.country}} </td>
																	</tr>
																</tbody>
															</table>
														</div>
													</div>
													<div class="tab-pane" id="admin-tab">
														<div class="table-responsive">
															<table class="table mb-0">
																<tbody>
																	<tr class="table-info">
																		<td><b>ID</b></td>
																		<td><span class="fe-user"></span>&nbsp;{{history.domain.domain_info.admin.id_str}}</td>
																	</tr>
																	<tr class="">
																		<td><b>Name</b></td>
																		<td><span class="fe-user"></span>&nbsp;{{history.domain.domain_info.admin.name}}</td>
																	</tr>
																	<tr class="table-primary">
																		<td><b>Organization</b></td>
																		<td><span class="fe-briefcase"></span>&nbsp;{{history.domain.domain_info.admin.organization}}</td>
																	</tr>
																	<tr class="">
																		<td><b>Email</b></td>
																		<td><span class="fe-mail"></span>&nbsp;{{history.domain.domain_info.admin.email}}</td>
																	</tr>
																	<tr class="table-info">
																		<td><b>Phone/Fax</b></td>
																		<td>
																			{% if history.domain.domain_info.admin.phone %}
																			<span class="fe-phone"></span>&nbsp;{{history.domain.domain_info.admin.phone}}
																			{% endif %}
																			{% if history.domain.domain_info.admin.fax %}
																			<span class="fe-printer"></span>&nbsp;{{history.domain.domain_info.admin.fax}}
																		</td>
																		{% endif %}
																	</tr>
																	<tr class="">
																		<td><b>Address</b></td>
																		<td><span class="fe-home"></span>&nbsp;{{history.domain.domain_info.admin.address}}</td>
																	</tr>
																	<tr class="table-danger">
																		<td><b>Address</b></td>
																		<td><b>City: </b>{{history.domain.domain_info.admin.city}} <b>State: </b>{{history.domain.domain_info.admin.state}} <b>Zip Code: </b>{{history.domain.domain_info.admin.zip_code}} <b>Country:
																		</b>{{history.domain.domain_info.admin.country}} </td>
																	</tr>
																</tbody>
															</table>
														</div>
													</div>
													<div class="tab-pane" id="technical-tab">
														<div class="table-responsive">
															<table class="table mb-0">
																<tbody>
																	<tr class="table-info">
																		<td><b>ID</b></td>
																		<td><span class="fe-user"></span>&nbsp;{{history.domain.domain_info.admin.id_str}}</td>
																	</tr>
																	<tr class="">
																		<td><b>Name</b></td>
																		<td><span class="fe-user"></span>&nbsp;{{history.domain.domain_info.admin.name}}</td>
																	</tr>
																	<tr class="table-primary">
																		<td><b>Organization</b></td>
																		<td><span class="fe-briefcase"></span>&nbsp;{{history.domain.domain_info.admin.organization}}</td>
																	</tr>
																	<tr class="">
																		<td><b>Email</b></td>
																		<td><span class="fe-mail"></span>&nbsp;{{history.domain.domain_info.admin.email}}</td>
																	</tr>
																	<tr class="table-info">
																		<td><b>Phone/Fax</b></td>
																		<td>
																			{% if history.domain.domain_info.admin.phone %}
																			<span class="fe-phone"></span>&nbsp;{{history.domain.domain_info.admin.phone}}
																			{% endif %}
																			{% if history.domain.domain_info.admin.fax %}
																			<span class="fe-printer"></span>&nbsp;{{history.domain.domain_info.admin.fax}}
																		</td>
																		{% endif %}
																	</tr>
																	<tr class="">
																		<td><b>Address</b></td>
																		<td><span class="fe-home"></span>&nbsp;{{history.domain.domain_info.admin.address}}</td>
																	</tr>
																	<tr class="table-danger">
																		<td><b>Address</b></td>
																		<td><b>City: </b>{{history.domain.domain_info.tech.city}} <b>State: </b>{{history.domain.domain_info.tech.state}} <b>Zip Code: </b>{{history.domain.domain_info.tech.zip_code}} <b>Country:
																		</b>{{history.domain.domain_info.tech.country}} </td>
																	</tr>
																</tbody>
															</table>
														</div>
													</div>
												</div>
											</div>
											<div class="tab-pane fade" id="v-pills-history" role="tabpanel" aria-labelledby="v-pills-history-tab" data-simplebar style="max-height: 300px; min-height: 300px;">
												{% if history.domain.domain_info.historical_ips.all %}
												<div class="alert alert-success">{{history.domain.domain_info.historical_ips.all.count}} Historical Ips</div>
												<table id="basic-datatable" class="table dt-responsive w-100">
													<thead>
															<tr>
																	<th>IP</th>
																	<th>Location</th>
																	<th>Owner</th>
																	<th>Last Seen</th>
															</tr>
													</thead>
													<tbody>
														{% for ip in history.domain.domain_info.historical_ips.all %}
														<tr>
															<td><b>{{ip.ip}}</b></td>
															<td>{{ip.location}}</td>
															<td>{{ip.owner}}</td>
															<td>{{ip.last_seen}}</td>
														</tr>
														{% endfor %}
													</tbody>
												</table>
												{% else %}
												<div class="alert alert-info">No historical IPs found!</div>
												{% endif %}
											</div>
											<div class="tab-pane fade" id="v-pills-nameserver" role="tabpanel" aria-labelledby="v-pills-nameserver-tab" data-simplebar style="max-height: 300px; min-height: 300px;">
												{% if history.domain.domain_info.name_servers.all %}
													<div class="alert alert-success">{{history.domain.domain_info.name_servers.all.count}} NameServers identified</div>
													{% for nameserver in history.domain.domain_info.name_servers.all %}
														<span class="badge badge-soft-primary me-1 mt-1">{{ nameserver}}</span>
													{% endfor %}
												{% else %}
													<div class="alert alert-info">No NameServers identified</div>
												{% endif %}
											</div>
											<div class="tab-pane fade" id="v-pills-related" role="tabpanel" aria-labelledby="v-pills-related-tab" data-simplebar style="max-height: 300px; min-height: 300px;">
												{% if history.domain.domain_info.related_domains.all %}
													<div class="alert alert-success">{{history.domain.domain_info.related_domains.all.count}} Related Domains identified</div>
													{% for domain in history.domain.domain_info.related_domains.all %}
														<span class="badge badge-soft-primary badge-link waves-effect waves-light me-1" data-toggle="tooltip" title="Add {{domain}} as target." onclick="add_target('{{domain}}')">{{domain}}</span>
													{% endfor %}
												{% else %}
													<div class="alert alert-info">No Related Domains identified</div>
												{% endif %}
											</div>
											<div class="tab-pane fade" id="v-pills-similar" role="tabpanel" aria-labelledby="v-pills-similar-tab" data-simplebar style="max-height: 300px; min-height: 300px;">
												{% if history.domain.domain_info.related_tlds.all %}
													<div class="alert alert-success">{{history.domain.domain_info.related_tlds.all.count}} Related TLDs identified</div>
													{% for domain in history.domain.domain_info.related_tlds.all %}
														<span class="badge badge-soft-primary badge-link waves-effect waves-light me-1" data-toggle="tooltip" title="Add {{domain}} as target." onclick="add_target('{{domain}}')">{{domain}}</span>
													{% endfor %}
												{% else %}
													<div class="alert alert-info">No Related TLDs identified</div>
												{% endif %}
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="col-xl-5 col-lg-5 col-12">
						<div class="card" style="height: 95%">
							<div class="card-body">
								<h4 class="header-title mb-0">HTTP Status Breakdown</h4>
								<div id="http_status_chart" class="apex-charts"></div>
							</div>
						</div>
					</div>
					<div class="col-xl-12 col-lg-12 col-12">
						<div class="card">
							<div class="card-body">
								<div class="row">
									<div class="col-9">
										<h4 class="header-title mb-0">Geographical Distribution of Assets</h4>
										<div id="world_map" style="height: 520px"></div>
									</div>
									<div class="col-3">
										<div class="table-responsive" data-simplebar style="max-height: 520px;">
											<table class="table table-borderless table-hover table-centered m-0">
												<thead class="table-light">
													<tr>
														<th>&nbsp;</th>
														<th>Country</th>
														<th>Assets</th>
													</tr>
												</thead>
												<tbody>
													{% for country in asset_countries %}
													<tr>
														<td><span class="fi fi-{{country.iso|lower}}"></span></td>
														<td>{{country.name}}</td>
														<td>{{country.count}}</td>
													</tr>
													{% endfor %}
												</tbody>
											</table>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					{% if total_vulnerability_count > 0 %}
					<div class="col-xl-5 col-lg-5 col-12">
						{% include 'base/_items/widgets/vulnerability_breakdown_by_severity_chart.html' %}
					</div>
					<div class="col-xl-7 col-lg-7 col-12">
						{% include 'base/_items/widgets/vulnerability_highlights.html' %}
					</div>
					{% include 'base/_items/most_common_cve_cwe_tag_template.html' %}
					<div class="col-xl-6 col-lg-6 col-12">
						{% include 'base/_items/most_vuln_target.html' with most_vuln_widget_title='Most Vulnerable Subdomain'%}
					</div>
					<div class="col-xl-6 col-lg-6 col-12">
						{% include 'base/_items/most_common_vuln.html' %}
					</div>
					{% endif %}
					<div class="col-xl-6 col-lg-6 col-12">
						<div class="card">
							<div class="card-body">
								<h4 class="header-title mb-0"><span id="important-count"><span class="spinner-border spinner-border-sm me-1"></span></span>Important Subdomains</h4>
								<div class="p-2" data-simplebar style="max-height: 235px; min-height: 235px;">
									<div id="important-subdomains-list">
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="col-xl-6 col-lg-6 col-12">
						<div class="card">
							<div class="card-body">
								<h4 class="header-title mb-0"><span id="tasks-count"><span class="spinner-border spinner-border-sm me-1"></span></span>
									Recon Note/Todo
									<span class="text-primary float-end" data-toggle="tooltip" data-placement="top" title="Add Recon Todo" onclick="add_todo_for_scanhistory_modal({{history.id}})">
										<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
									</span>
								</h4>
								<div class="p-2">
									<div style="max-height: 210px;min-height: 210px;" data-simplebar>
										<ul class="list-group list-group-flush todo-list" id="todo-list"></ul>
									</div>
								</div>
								<div class="modal fade" id="addTaskModal" tabindex="-1" role="dialog" aria-labelledby="addTaskModalTitle" aria-hidden="true">
									<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
										<div class="modal-content">
											<div class="modal-body">
												<div class="compose-box">
													<div class="compose-content" id="addTaskModalTitle">
														<h4 class="header-title">Add Recon Todo</h4>
														<form>
															<input type="hidden" name="summary_identifier" value="{{history.id}}" id="summary_identifier_val">

															<div class="mt-2">
																<label for="todoTitle" class="form-label">Todo Title</label>
																<input id="todoTitle" type="text" placeholder="Todo Title" class="form-control" name="task">
															</div>

															<div class="mt-2">
																<label for="todoSubdomainDropdown" class="form-label">Select Subdomain (Optional)</label>
																<span id="selectedSubdomainCount"></span>
																<select class="w-100 form-control" data-toggle="select2" data-width="100%" id="todoSubdomainDropdown">
																	<option>Choose Subdomain...</option>
																</select>
															</div>

															<div class="">
																<label for="todoDescription" class="form-label">Todo Description (Optional)</label>
																<textarea class="form-control" id="todoDescription" rows="5" spellcheck="false" placeholder="Todo Description"></textarea>
															</div>
														</form>
													</div>
												</div>
											</div>
											<div class="modal-footer">
												<button class="btn btn-primary add-scan-history-todo">Add Recon Todo</button>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="col-xl-4 col-lg-4 col-12">
						<div class="card">
							<div class="card-body">
								<h4 class="header-title mb-0"><span id="ip-address-count"><span class="spinner-border spinner-border-sm me-1"></span></span> IP Addresses</h4>
								<small class="text-warning float-end">*IP Addresses highlighted with yellow are CDN IP</small>
								<br>
								<div class="p-2" data-simplebar style="max-height: 235px; min-height: 235px;">
									<div id="ip-address" class="mt-2"></div>
								</div>
							</div>
						</div>
					</div>
					<div class="col-xl-4 col-lg-4 col-12">
						<div class="card">
							<div class="card-body">
								<h4 class="header-title mb-0"><span id="ports-count"><span class="spinner-border spinner-border-sm me-1"></span></span> Discovered Ports</h4>
								<small class="text-danger float-end">*Ports highlighted with red are uncommon Ports</small>
								<br>
								<div class="p-2" data-simplebar style="max-height: 235px; min-height: 235px;">
									<div id="ports" class="mt-2"></div>
								</div>
							</div>
						</div>
					</div>
					<div class="col-xl-4 col-lg-4 col-12">
						<div class="card">
							<div class="card-body">
								<h4 class="header-title mb-0"><span id="technologies-count"><span class="spinner-border spinner-border-sm me-1"></span></span> Discovered Technologies</h4>
								<small class="text-warning float-end">&nbsp;</small>
								<br>
								<div class="p-2" data-simplebar style="max-height: 235px; min-height: 235px;">
									<div id="technologies" class="mt-2"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="tab-pane" id="subdomain-tab">
		{% include 'base/_items/subdomain_tab_content.html' with detail_scan=True%}
	</div>
	<div class="tab-pane" id="buckets-tab">
		<div class="row">
			<div class="col-12">
				<div class="card">
					<div class="p-2">
						<div class="table-responsive">
							<table id="s3-datatable" class="table dt-responsive w-100">
								<thead>
									<tr>
										<th>Name</th>
										<th>Region</th>
										<th>Provider</th>
										<th>Owner</th>
										<th>Objects Count</th>
										<th>Bucket Size</th>
										<th>Auth Users Permission</th>
										<th>All Users Permission</th>
									</tr>
								</thead>
								<tbody>
									{% for bucket in history.buckets.all %}
										<tr>
											<td><h5 class="m-0 fw-normal">{{bucket.name}}</h5></td>
											<td>{{bucket.region}}</td>
											<td>{{bucket.provider}}</td>
											<td>
												<ul>
													<li>ID: {{bucket.owner_id}}</li>
													<li>Display Name: {{bucket.owner_display_name}}</li>
												</ul>
											</td>
											<td>{{bucket.num_objects}}</td>
											<td>{{bucket.size}}</td>
											<td>
												<ul>
													{% if bucket.perm_auth_users_read == 1 %}<li><strong>READ</strong></li>{% endif %}
													{% if bucket.perm_auth_users_write == 1 %}<li><strong>WRITE</strong></li>{% endif %}
													{% if bucket.perm_auth_users_read_acl == 1 %}<li><strong>Read_ACP</strong></li>{% endif %}
													{% if bucket.perm_auth_users_write_acl == 1 %}<li><strong>WRITE_ACP</strong></li>{% endif %}
													{% if bucket.perm_auth_users_full_control == 1 %}<li><strong>FULL_CONTROL</strong></li>{% endif %}
												</ul>
											</td>
											<td>
												<ul>
													{% if bucket.perm_all_users_read == 1 %}<li><strong>READ</strong></li>{% endif %}
													{% if bucket.perm_all_users_write == 1 %}<li><strong>WRITE</strong></li>{% endif %}
													{% if bucket.perm_all_users_read_acl == 1 %}<li><strong>Read_ACP</strong></li>{% endif %}
													{% if bucket.perm_all_users_write_acl == 1 %}<li><strong>WRITE_ACP</strong></li>{% endif %}
													{% if bucket.perm_all_users_full_control == 1 %}<li><strong>FULL_CONTROL</strong></li>{% endif %}
												</ul>
											</td>
										</tr>
									{% endfor %}
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	{% if 'screenshot' in history.tasks %}
	<div class="tab-pane" id="screenshot-tab">
		<div class="col-lg-8 col-md-8 col-sm-9 filtered-list-search mx-auto">
			<input type="text" class="form-control form-control-lg br-30 mb-3" id="screenshot-search" placeholder="">
		</div>
		<div class="row">
			<div class="col-12">
				<div class="card">
					<div class="p-2">
						<div class="row" id="filter-screenshot" style="display: none;">
							<div class="col-xl-6 col-lg-6 col-sm-6">
								<h5 class=""><i class="fe-filter text-primary"></i> Filter Screenshots</h5>
							</div>
							<div class="col-xl-6 col-lg-6 col-sm-6">
								<div class="float-end">
									<a class="arrow-none waves-effect waves-light" data-toggle="fullscreen" href="#">
										<i class="fe-maximize noti-icon"></i>
									</a>
								</div>
							</div>
							<div class="row">
								<div class="col-xl-2 col-lg-4 col-sm-12">
									<label for="http_select_filter" class="form-label">HTTP Status</label>
									<select class="form-control tagging" id="http_select_filter" multiple="multiple" data-width="100%">
									</select>
								</div>
								<div class="col-xl-2 col-lg-4 col-sm-12">
									<label for="ips_select_filter" class="form-label">IP Address</label>
									<select class="form-control tagging" id="ips_select_filter" multiple="multiple" data-width="100%">
									</select>
								</div>
								{% if 'port_scan' in history.tasks %}
								<div class="col-xl-2 col-lg-4 col-sm-12">
									<label for="services_select_filter" class="form-label">Running Services</label>
									<select class="form-control tagging" id="services_select_filter" multiple="multiple" data-width="100%">
									</select>
								</div>
								<div class="col-xl-2 col-lg-4 col-sm-12">
									<label for="ports_select_filter" class="form-label">Ports</label>
									<select class="form-control tagging" id="ports_select_filter" multiple="multiple" data-width="100%">
									</select>
								</div>
								{% endif %}
								<div class="col-xl-2 col-lg-4 col-sm-12">
									<label for="tech_select_filter" class="form-label">Technology</label>
									<select class="form-control tagging" id="tech_select_filter" multiple="multiple" data-width="100%">
									</select>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-12">
				<div class="card">
					<div class="card-body">
						<div class="row">
							<div class="col-12">
								<div id="screenshot-loader">
									<div class="outer-div d-flex justify-content-center">
										<div class="spinner-grow text-primary m-2"></div>
									</div>
									<h5 class="text-center mt-3">Loading Screenshots...</h5>
								</div>
							</div>
							<div class="col-12">
								<div class="gridzy" id="screenshots-table">
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	{% endif %}

	{# endpoints section #}
	<div class="tab-pane" id="endpoints-tab">
		{% include 'base/_items/endpoint_tab_content.html' with detail_scan=True%}
	</div>

	{# directories section #}
	{% if 'dir_file_fuzz' in history.tasks %}
	<div class="tab-pane" id="directories-tab">
		<div class="row">
			<div class="col-12">
				<div class="card">
					<div class="card-body">
						<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-bs-toggle="dropdown" aria-expanded="false">Display <span class="caret"></span></button>
						<table id="directories-table" class="table dt-responsive w-100">
							<thead>
								<tr>
									<th class="checkbox-column">Status</th>
									<th>Subdomain</th>
									<th>Status</th>
									<th>Page Title</th>
									<th>Directories</th>
									<th>HTTP URL</th>
									<th>Is Intereting</th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
	{% endif %}

	{# Vulnerabilities Section #}
	{% if total_vulnerability_count > 0 %}
	<div class="tab-pane" id="vulnerabilities-tab">
		{% include 'base/_items/vulnerability_tab_content.html' %}
	</div>
	{% endif %}

	{# OSINT Section #}
	{% if 'osint' in history.tasks %}
	<div class="tab-pane" id="osint-tab">
		<div class="card" id="dorking_result_card">
			<div class="card-body">
				<h4 class="header-title mb-4">Dorking Results</h4>
				<div class="row">
					<div class="col-sm-3">
						<div class="nav flex-column nav-pills nav-pills-tab" id="dork_type_vertical_tablist" role="tablist" aria-orientation="vertical">
						</div>
					</div>
					<!-- end col-->
					<div class="col-sm-9">
						<div class="tab-content pt-0" id="dork_tab_content">
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-xl-5 col-lg-5 col-md-12 col-sm-12 col-12">
				<div class="card">
					<div class="card-body">
						<h4 class="header-title mb-0">
							<span id="employees-count">
								<span class="spinner-border spinner-border-sm me-1"></span>
							</span>
							Employees/People associated with {{history.domain.name}}
						</h4>
						<table class="table mt-3">
							<thead class="table-light">
								<tr>
									<th><div class="th-content">Employee Name</div></th>
									<th><div class="th-content">Designation</div></th>
								</tr>
							</thead>
							<tbody id="employees-table-body">
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<div class="col-xl-7 col-lg-7 col-md-12 col-sm-12 col-12">
				<div class="card">
					<div class="card-body">
						<h4 class="header-title mb-0">
							<span id="emails-count">
								<span class="spinner-border spinner-border-sm me-1"></span>
							</span>
							Discovered Email addresses  <span id="exposed_summary" class="text-danger"></span>
						</h4>
						<table class="table mt-3">
							<thead class="table-light">
								<tr>
									<th><div class="th-content">Email Address</div></th>
									<th><div class="th-content">Exposed Credentials</div></th>
								</tr>
							</thead>
							<tbody id="email-table-body">
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
				<div class="card">
					<div class="card-body">
						<h4 class="header-title mb-0">
							<span id="metadata-count">
								<span class="spinner-border spinner-border-sm me-1"></span>
							</span>
							Discovered Metadata
						</h4>
						<table class="table mt-3">
							<thead class="table-light">
								<tr>
									<th><div class="th-content">Document</div></th>
									<th><div class="th-content text-center">User</div></th>
									<th><div class="th-content text-center">Metadata</div></th>
								</tr>
							</thead>
							<tbody id="metadata-table-body">
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
	{% endif %}

	{# visualisation section #}
	<div class="tab-pane" id="visualisation-tab">
		<div class="row">
			<div class="col-12">
				<div class="card">
					<div class="card-body">
						<div id="visualisation-filter" style="display:none">
							<div class="row">
								<div class="col-6">
									<div class="form-check form-switch">
										<input type="checkbox" class="form-check-input" name="expand-nodes-checkbox" checked>
										<label class="form-check-label" for="customSwitch1">&nbsp; &nbsp; Expand all nodes</label>
									</div>
								</div>
								<div class="col-6">
									<div class="dropdown float-end">
										<a href="#" class="dropdown-toggle arrow-none card-drop" data-bs-toggle="dropdown" aria-expanded="false">
											<i class="mdi mdi-dots-vertical"></i>
										</a>
										<div class="dropdown-menu dropdown-menu-end" style="">
											<a href="#" class="dropdown-item" id="saveButton">Download Visualization as png</a>
										</div>
									</div>
								</div>
							</div>
						</div>
						<hr>
						<div id="visualisation-loader">
							<div class="d-flex justify-content-center" id="visualisation-loader">
								<div class="spinner-border" role="status">
									<span class="visually-hidden">Loading...</span>
								</div>
							</div>
							<h5 class="text-center mt-3">Loading Recon Visualization...</h5>
						</div>
						<div class="row">
							<div class="col-10">
								<div id="visualisation">
								</div>
							</div>
							<div class="col-2">
								<div class="float-end m-3">
									<small class="text-success text-right"style="display: block;">*Subdomains highlighted with green are 20X (OK) HTTP status</small>
									<small class="text-warning text-right"style="display: block;">*Subdomains highlighted with orange are 30X (Redirect) HTTP status</small>
									<small class="text-danger text-right" style="display: block;">*Subdomains highlighted with red are 40X (Not found) HTTP status</small>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	{# Interesting Recon section #}
	<div class="tab-pane interesting-tab-show" style="display: none" id="interesting-tab">
		<div class="row">
			<div class="col-xl-12">
				<div class="card" id="interesting_subdomain_div">
					<div class="card-body">
						<div class="dropdown float-end">
							<a href="#" class="dropdown-toggle arrow-none card-drop" data-bs-toggle="dropdown" aria-expanded="false">
								<i class="mdi mdi-dots-vertical"></i>
							</a>
							<div class="dropdown-menu dropdown-menu-end">
								<a class="dropdown-item" href="javascript:download_interesting_subdomains({{scan_history_id}}, '{{history.domain.name}}');">Download Interesting Subdomains</a>
							</div>
						</div>
						<h4 class="header-title mb-0"><span id="interesting_subdomain_count_badge"><span class="spinner-border spinner-border-sm me-1"></span></span> Interesting Subdomains</h4>
						<table id="interesting_subdomains" class="table dt-responsive w-100">
							<thead>
								<tr>
									<th>Subdomain</th>
									<th>Page Title</th>
									<th>HTTP Status</th>
									<th>Content Length</th>
									<th>HTTP URL</th>
									<th>Tech Stack</th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
			</div>
			<div class="col-xl-12" id="interesting_endpoint_div">
				<div class="card">
					<div class="card-body">
						<div class="dropdown float-end">
							<a href="#" class="dropdown-toggle arrow-none card-drop" data-bs-toggle="dropdown" aria-expanded="false">
								<i class="mdi mdi-dots-vertical"></i>
							</a>
							<div class="dropdown-menu dropdown-menu-end">
								<a class="dropdown-item" href="javascript:download_interesting_endpoints({{scan_history_id}}, '{{history.domain.name}}');">Download Interesting Endpoints</a>
							</div>
						</div>
						<h4 class="header-title mb-0"><span id="interesting_endpoint_count_badge"><span class="spinner-border spinner-border-sm me-1"></span></span> Interesting Endpoints</h4>
						<table id="interesting_endpoints" class="table dt-responsive w-100">
							<thead>
								<tr>
									<th>URL</th>
									<th>Title</th>
									<th>HTTP Status</th>
									<th>Content Length</th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>

	{# Recon Data Changes section #}
	<div class="tab-pane recon-changes-tab-show" id="recon-changes-tab" style="display: none">
		<div class="row">
			<div class="col-xl-12">
				<div class="card" id="recon_changes_subdomain_div">
					<div class="card-body">
						<h4 class="header-title mb-0"><span id="subdomain_change_count"><span class="spinner-border spinner-border-sm me-1"></span></span> Subdomain Changes</h4>
						<table class="table dt-responsive w-100" id="table-subdomain-changes">
							<thead>
								<tr>
									<th>Subdomain</th>
									<th>Page Title</th>
									<th>Status</th>
									<th>Content Length</th>
									<th>Change</th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
			</div>
			<div class="col-xl-12" id="endpoint-changes-div">
				<div class="card">
					<div class="card-body">
						<h4 class="header-title mb-0"><span id="endpoint_change_count"><span class="spinner-border spinner-border-sm me-1"></span></span> Endpoint Changes</h4>
						<table class="table dt-responsive w-100" id="table-endpoint-changes">
							<thead>
								<tr>
									<th>Subdomain</th>
									<th>Page Title</th>
									<th>Status</th>
									<th>Content Length</th>
									<th>Change</th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>

</div>
{% include "base/_items/recon_note_modal.html" %}
{% include "base/_items/subscan_modal.html" with detail_scan=True %}

{# for passing subdomain id to initiate subtask scan #}
<input type="hidden" name="subtask_subdomain_id" id="subtask_subdomain_id" value="0">

{% endblock main_content %}

{% block page_level_script %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/apexcharts/3.29.0/apexcharts.min.js" integrity="sha512-fe6OklXva8AWoqdwgkE7Ni4uWgHGWxFQWZx4lYehzY2Qrst5YfogjAbnLd6egsoTrnjGI9/LYt1Ont2cKNbP2A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://apexcharts.com/samples/assets/irregular-data-series.js"></script>
<script src="https://apexcharts.com/samples/assets/ohlc.js"></script>
<script src="{% static 'custom/todo.js' %}"></script>
<script src="{% static 'note/js/todo.js' %}"></script>
<script src="{% static 'custom/subdomain.js' %}"></script>
<script src="{% static 'startScan/js/detail_scan.js' %}"></script>
<script src="{% static 'plugins/lightbox/js/lightbox.js' %}"></script>
<script src="{% static 'plugins/perfect-scrollbar/perfect-scrollbar.min.js' %}"></script>
<script src="{% static 'assets/js/clipboard.min.js' %}"></script>
<script src="{% static 'plugins/select2/select2.min.js' %}"></script>
<script src="{% static 'plugins/j-map/jquery-jvectormap.min.js' %}"></script>
<script src="{% static 'plugins/j-map/maps/jquery-jvectormap-world-mill-en.js' %}"></script>
<script src="{% static 'custom/vuln_datatables.js' %}"></script>
{# search suggestions scripts #}
<script src="{% static 'startScan/js/subdomains-suggestions.js' %}"></script>
<script src="{% static 'startScan/js/endpoint-datatables-suggestions.js' %}"></script>
<script src="{% static 'custom/subdomain_datatable.js' %}"></script>

{% if total_vulnerability_count > 0 %}
<script src="{% static 'startScan/js/vulnerability-datatables-suggestions.js' %}"></script>
{% endif %}

{# visualisation libraries #}
<script src="{% static 'custom/mitch.js' %}"></script>

<script type="text/javascript">
$(document).ready(function() {
	// Init
	const ps = new PerfectScrollbar(document.querySelector('.mt-container'));
	const ps1 = new PerfectScrollbar(document.querySelector('.endpoint-search'));
	$('[data-toggle="tooltip"]').tooltip();
	$('#addTaskModal select').css('width', '100%');
	$("#todoSubdomainDropdown").select2({
			dropdownParent: $('#addTaskModal')
	});
	var clipboard = new Clipboard('.copyable');

	$(".tagging").select2({
			tags: true
	});

	//populate charts
	// http_status breakdown chart
	var colors = [
		{% for status in http_status_breakdown %}
		{% if status.http_status >= 200 and status.http_status < 300 %}
		'#4CAF50',
		{% elif status.http_status >= 300 and status.http_status < 400 %}
		'#FFC107',
		{% else %}
		'#F44336',
		{% endif %}
		{% endfor %}
	];

	// http_status chart
	var options = {
		series: [{
			name: 'Subdomains',
			data: [{% for status in http_status_breakdown %}
				{{status.http_status__count}},
				{% endfor %}]
			}],
			chart: {
				height: 350,
				type: 'bar',
				events: {
					click: function(chart, w, e) {
						// console.log(chart, w, e)
					}
				}
			},
			colors: colors,
			plotOptions: {
				bar: {
					columnWidth: '45%',
					distributed: true,
				}
			},
			dataLabels: {
				enabled: false
			},
			legend: {
				show: false
			},
			xaxis: {
				categories: [
					{% for status in http_status_breakdown %}
					'{{status.http_status}}',
					{% endfor %}
				],
				labels: {
					style: {
						colors: colors,
						fontSize: '12px'
					}
				}
			}
	};
	var chart = new ApexCharts(document.querySelector("#http_status_chart"), options);
	chart.render();
	// vulnerability summary pie chart
	{% if total_vulnerability_count > 0 %}
		{% include 'base/_items/most_common_cve_cwe_tags.js' %}
	// chart
		var options = {
			chart: {
				type: 'donut',
				height: 280,
			},
			colors: ['#D50000', '#F44336', '#FF6D00', '#FFD600', '#2962FF', '#03A9F4'],
			dataLabels: {
				enabled: false
			},
			legend: {
				show: !0,
				position: "bottom",
				horizontalAlign: "center",
				verticalAlign: "middle",
				floating: !1,
				fontSize: "15px",
				offsetX: 0,
				offsetY: 7
			},
			plotOptions: {
				pie: {
					donut: {
						size: '70%',
						background: 'transparent',
						labels: {
							show: true,
							name: {
								show: true,
								fontSize: '29px',
								fontFamily: 'Nunito, sans-serif',
								color: undefined,
								offsetY: -10
							},
							value: {
								show: true,
								fontSize: '26px',
								fontFamily: 'Nunito, sans-serif',
								color: '20',
								offsetY: 16,
								formatter: function (val) {
									return val
								}
							},
							total: {
								show: true,
								showAlways: true,
								label: 'Total',
								color: '#888ea8',
								formatter: function (w) {
									return w.globals.seriesTotals.reduce( function(a, b) {
										return a + b
									}, 0)
								}
							}
						}
					}
				}
			},
			series: [{{critical_count}}, {{high_count}}, {{medium_count}}, {{low_count}}, {{info_count}}, {{unknown_count}}],
			labels: ['Critical', 'High', 'Medium', 'Low', 'Info', 'Unknown'],
			responsive: [{
				breakpoint: 1599,
				options: {
					chart: {
						height: 240
					},
					legend: {
						position: 'bottom'
					}
				},
				breakpoint: 1439,
				options: {
					chart: {
						width: '250px',
						height: '390px'
					},
				},
			}],
		}

		var chart = new ApexCharts(
			document.querySelector("#vulnerability-pie-chart"),
			options
		);

		chart.render()

		// vulnerability datatable
		const ps2 = new PerfectScrollbar(document.querySelector('.vulnerability-search'));
		$("#pills-vulnerabilities-tab").click(function() {
			// prevent table loading twice
			// https://datatables.net/manual/tech-notes/3
			if ( $.fn.dataTable.isDataTable( '#vulnerability_results' ) ) {
				return false;
			}
			var is_grouping = false;
			var grouping_col = 3;
			var vuln_ajax_url = '/api/listVulnerability/?scan_history={{scan_history_id}}&format=datatables';
			var vulnerability_table = $('#vulnerability_results').DataTable({
				"destroy": true,
				"oLanguage": {
					"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
					"sInfo": "Showing page _PAGE_ of _PAGES_",
					"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
					"sSearchPlaceholder": "Search...",
					"sLengthMenu": "Results :  _MENU_",
				},
				"processing": true,
				"dom": "<'dt--top-section'<'row'<'col-12 mb-3 mb-sm-0 col-sm-4 col-md-3 col-lg-4 d-flex justify-content-sm-start justify-content-center'l><'dt--pages-count col-12 col-sm-6 col-md-4 col-lg-4 d-flex justify-content-sm-middle justify-content-center'i><'dt--pagination col-12 col-sm-2 col-md-5 col-lg-4 d-flex justify-content-sm-end justify-content-center'p>>>" +
				"<'table-responsive'tr>" +
				"<'dt--bottom-section'<'row'<'col-12 mb-3 mb-sm-0 col-sm-4 col-md-3 col-lg-4 d-flex justify-content-sm-start justify-content-center'l><'dt--pages-count col-12 col-sm-6 col-md-4 col-lg-4 d-flex justify-content-sm-middle justify-content-center'i><'dt--pagination col-12 col-sm-2 col-md-5 col-lg-4 d-flex justify-content-sm-end justify-content-center'p>>>",
				"stripeClasses": [],
				"lengthMenu": vuln_datatable_length_menu,
				"pageLength": vuln_datatable_page_length,
				'serverSide': true,
				"ajax": {
						'url': vuln_ajax_url,
				},
				"rowGroup": {
					"startRender": function(rows, group) {
						return group + ' (' + rows.count() + ' Vulnerabilities)';
					}
				},
				"order": [[ 7, "desc" ]],
				"columns": vuln_datatable_columns,
				"columnDefs": [
					{ "orderable": false, "targets": [16]},
					{
						"targets": [2, 4, 5, 6, 8, 9, 10, 12, 13, 14, 17, 18, 19],
						"visible": false,
						"searchable": true,
					},
					{
						"targets": [20, 21, 22, 23, 24, 25, 26, 27],
						"visible": false,
						"searchable": false,
					},
					{"className": "text-center", "targets": []},
					{
						"render": function ( data, type, row ) {
							if(row['open_status']){
								return `<div class="form-check mb-2 form-check-primary"><input type="checkbox" name="targets_checkbox['+ e + ']" class="float-start form-check-input" onchange="vuln_status_change(this, `+data+`);">\n<span class="new-control-indicator"></span><span style="visibility:hidden">c</span></div>`;
							}
							else{
								return `<div class="form-check mb-2 form-check-primary"><input type="checkbox" checked name="targets_checkbox['+ e + ']" class="float-start form-check-input" onchange="vuln_status_change(this, `+data+`);">\n<span class="new-control-indicator"></span><span style="visibility:hidden">c</span></div>`;
							}
						},
						"targets": 0,
					},
					{
						"render": function ( data, type, row ) {
							if (data) {
								return `<span class="badge badge-outline-primary">&nbsp;&nbsp;${data.toUpperCase()}&nbsp;&nbsp;</span>`;
							}
						},
						"targets": 1,
					},
					{
						"render": function ( data, type, row ) {
							if (data) {
								return `<span class="badge badge-soft-primary">&nbsp;&nbsp;${data.toUpperCase()}&nbsp;&nbsp;</span>`;
							}
						},
						"targets": 2,
					},
					{
						"render": function ( data, type, row ) {
							var tags = '';
							var cvss_metrics_badge = '';
							var cve_cwe_badge = '';
							switch (row['severity']) {
								case 'Info':
								color = 'primary';
								badge_color = 'soft-primary';
								break;
								case 'Low':
								color = 'low';
								badge_color = 'soft-warning';
								break;
								case 'Medium':
								color = 'warning';
								badge_color = 'soft-warning';
								break;
								case 'High':
								color = 'danger';
								badge_color = 'soft-danger';
								break;
								case 'Critical':
								color = 'critical';
								badge_color = 'critical';
								break;
								case 'Unknown':
								color = 'info';
								badge_color = 'soft-info';
								break;
								default:
							}
							if (row['tags']) {
								tags = '<div>';
								row['tags'].forEach(tag => {
									tags += `<span class="badge badge-${badge_color} me-1 mt-1" data-toggle="tooltip" data-placement="top" title="Tags">${tag.name}</span>`;
								});
								tags += '</div>';
							}
							if (row['cvss_metrics']) {
								cvss_metrics_badge = `<div><span class="badge badge-outline-primary mt-1" data-toggle="tooltip" data-placement="top" title="CVSS Metrics">${row['cvss_metrics']}</span></div>`;
							}
							if (row['cve_ids'] || row['cwe_ids']) {
								cve_cwe_badge += '<br>';
							}
							if (row['cve_ids']) {
								row['cve_ids'].forEach(cve => {
									cve_cwe_badge += `<a href="#" onclick="get_and_render_cve_details('${cve.name.toUpperCase()}')" class="badge badge-outline-primary mt-1 me-1" data-toggle="tooltip" data-placement="top" title="CVE ID">${cve.name.toUpperCase()}</a>`;
								});
							}
							if (row['cwe_ids']) {
								row['cwe_ids'].forEach(cwe => {
									cve_cwe_badge += `<a href="https://google.com/search?q=${cwe.name.toUpperCase()}" target="_blank" class="badge badge-outline-primary mt-1 me-1" data-toggle="tooltip" data-placement="top" title="CWE ID">${cwe.name.toUpperCase()}</a>`;
								});
							}
							// if (cve_cwe_badge != "") {
							// 	cve_cwe_badge
							// }
							{% if user_preferences.bug_bounty_mode %}
								hackerone_report = row['hackerone_report_id'] ? `<div><a class="badge badge-soft-danger mt-1 me-1" href="https://hackerone.com/reports/${row['hackerone_report_id']}" target="_blank">Reported to hackerone</a></div>` : "";
							{% else %}
								hackerone_report = "";
							{% endif %}
							return `<b class="text-${color}">` + data + `</b>` + cvss_metrics_badge + cve_cwe_badge + tags + hackerone_report;
						},
						"targets": 3,
					},
					{
						"render": function ( data, type, row ) {
							return get_severity_badge(data);
						},
						"targets": 7,
					},
					{
						"render": function ( data, type, row ) {
							if (data) {
								if (data > 0.1 && data <= 3.9) {
									badge = 'info';
								}
								else if (data > 3.9 && data <= 6.9) {
									badge = 'warning';
								}
								else if (data > 6.9 && data <= 8.9) {
									badge = 'danger';
								}
								else{
									badge = 'danger';
								}
								return `<span class="badge badge-outline-${badge}" data-toggle="tooltip" data-placement="top" title="CVSS Score">${data}</span>`;
							}
							return '';
						},
						"targets": 8,
					},
					{
						"render": function ( data, type, row ) {
							if (data) {
								const encodedURLData = htmlEncode(data);
								
								if (data.toLowerCase().startsWith('http')) {
									return `<a href="${encodedURLData}" 
											target="_blank" 
											rel="noopener noreferrer" 
											class="text-danger">
											${split_into_lines(encodedURLData, 150)}
										</a>`;
								}
							}
							return htmlEncode(data || '');
						},
						"targets": 11,
					},
					{
						"render": function ( data, type, row ) {
							if (data){
								return '<span class="badge badge-soft-danger">&nbsp;&nbsp;OPEN&nbsp;&nbsp;</span>'
							}
							else{
								return '<span class="badge badge-soft-success">&nbsp;&nbsp;RESOLVED&nbsp;&nbsp;</span>'
							}
						},
						"targets": 15,
					},
					{
						"render": function ( data, type, row ) {
							if (!data){
								return `
								<div class="btn-group mb-2 dropstart">
								<a href="#" class="text-dark dropdown-toggle float-end" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
								<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-more-horizontal"><circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle></svg>
								</a>
								<div class="dropdown-menu" style="">
								<a class="dropdown-item" href="javascript:fetch_gpt_vuln_details(${row['id']}, '${row['name']}');">Fetch GPT Vulnerability Details</a>
								{% if user_preferences.bug_bounty_mode %}
									<a class="dropdown-item" href="javascript:report_hackerone(${row['id']}, '${row['severity']}');">Report to Hackerone</a>
								{% endif %}
								<a class="text-danger dropdown-item" href="javascript:delete_vulnerability(${row['id']});">Delete Vulnerability</a>
								</div>
								</div>`;
							}
							else{
								return '';
							}
						},
						"targets": 16,
					},
					{
						"render": function ( data, type, row ) {
							return htmlEncode(data);
						},
						"targets": 17,
					}
				],
				"initComplete": function(settings, json) {
					api = this.api();
					// column visibility
					vulnerability_datatable_col_visibility(vulnerability_table);
					$(".dtrg-group th:contains('No group')").remove();
				},
				drawCallback: function (settings) {
					drawCallback_api = this.api();
					$('.badge').tooltip({ template: '<div class="tooltip status" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>' })
					$('.bs-tooltip').tooltip();
					setTimeout(function() {
						$(".dtrg-group th:contains('No group')").remove();
					}, 1);
				},
				createdRow: function( row, data, dataIndex ) {
					if (!data['open_status']){
						$(row).addClass('table-success text-strike');
					}
				},
			});

			var radioGroup = document.getElementsByName('grouping_vuln_row');
			radioGroup.forEach(function(radioButton) {
				radioButton.addEventListener('change', function() {
					if (this.checked) {
						var groupRows = document.querySelectorAll('tr.group');
						var col_index = get_datatable_col_index(this.value, vuln_datatable_columns);
						api.page.len(-1).draw();
						api.order([col_index, 'asc']).draw();
						vulnerability_table.rowGroup().dataSrc(this.value);
						Snackbar.show({
							text: 'Vulnerabilities grouped by ' + this.value,
							pos: 'top-right',
							duration: 2500
						});
					}
				});
			});

			$('#reload_vulnerabilities_table_btn').click(function () {
				vulnerability_table.ajax.reload();
			});

			$('#vulnerability-search-button').click(function () {
				vulnerability_table.search($('#vulnerability-search').val()).draw() ;
			});

			$('input[name=vuln_source_checkbox]').change(function() {
				if ($(this).is(':checked')) {
					vulnerability_table.column(1).visible(true);
				} else {
					vulnerability_table.column(1).visible(false);
				}
				window.localStorage.setItem('vuln_source_checkbox', $(this).is(':checked'));
			});

			$('input[name=vuln_severity_checkbox]').change(function() {
				if ($(this).is(':checked')) {
					vulnerability_table.column(7).visible(true);
				} else {
					vulnerability_table.column(7).visible(false);
				}
				window.localStorage.setItem('vuln_severity_checkbox', $(this).is(':checked'));
			});

			$('input[name=vuln_vulnerable_url_checkbox]').change(function() {
				if ($(this).is(':checked')) {
					vulnerability_table.column(11).visible(true);
				} else {
					vulnerability_table.column(11).visible(false);
				}
				window.localStorage.setItem('vuln_vulnerable_url_checkbox', $(this).is(':checked'));
			});

			$('input[name=vuln_status_checkbox]').change(function() {
				if ($(this).is(':checked')) {
					vulnerability_table.column(15).visible(true);
				} else {
					vulnerability_table.column(15).visible(false);
				}
				window.localStorage.setItem('vuln_status_checkbox', $(this).is(':checked'));
			});

			$('#vulnerability_results').on('click', 'tr' , function (e) {
				if ($(e.target).is('input[type="checkbox"]') || $(e.target).is('svg') || $(e.target).is('a')) {
					return;
				}
				var data = vulnerability_table.row(this).data();
				render_vuln_offcanvas(data);
			});
		});
	{% endif %}

	{% if 'dir_file_fuzz' in history.tasks %}
		$("#pills-directories-tab").click(function() {
			var interesting_keywords_array = [];
			var directory_table = $('#directories-table').DataTable({
				"destroy": true,
				"oLanguage": {
					"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
					"sInfo": "Showing page _PAGE_ of _PAGES_",
					"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
					"sSearchPlaceholder": "Search...",
					"sLengthMenu": "Results :  _MENU_",
				},
				"processing": true,
				"stripeClasses": [],
				"lengthMenu": [20, 50, 100, 500, 1000],
				"pageLength": 20,
				'serverSide': true,
				"ajax": '/api/listDatatableSubdomain/?project={{current_project.slug}}&scan_id={{scan_history_id}}&format=datatables&only_directory',
				"order": [[ 5, "desc" ]],
				"columns": [
					{'data': 'id'},
					{'data': 'name'},
					{'data': 'http_status'},
					{'data': 'page_title'},
					{'data': 'directories'},
					{'data': 'http_url'},
					{'data': 'is_interesting'},
				],
				"columnDefs": [
					{
						"targets": [ 5, 6],
						"visible": false,
						"searchable": false,
					},
					{
						"targets":0, "width":"20px", "className":"", "orderable":!1, render:function(e, a, t, n) {
							return'<div class="form-check ms-1 form-check-primary"><input type="checkbox" name="subdomain_checkbox['+ e + ']" class="float-start form-check-input subdomain_checkbox" value="' + e + '" onchange=toggleMultipleSubdomainButton()>\n<span class="new-control-indicator"></span><span style="visibility:hidden">c</span></div>';
						}},
						{
							"render": function ( data, type, row ) {
								if (row['http_url']) {
									interesting_badge = '';
									if(row['is_interesting'])
									{
										interesting_badge = `<span class='me-1 badge badge-pills badge-soft-danger ms-1' data-toggle="tooltip" data-placement="top" title="Interesting Subdomain">Interesting</span>`;
									}
									return `<a href="`+row['http_url']+`" class="text-primary" target="_blank">`+data+`</a>`+interesting_badge+`<br>`;
								}
								return `<a href="https://`+data+`" class="text-primary" target="_blank">`+data+`</a>` + interesting_badge;
							},
							"targets": 1
						},
						{
							"render": function ( data, type, row ) {
								// display badge based on http status
								// green for http status 2XX, orange for 3XX and warning for everything else
								if (data >= 200 && data < 300) {
									return "<span class='badge badge-pills badge-soft-success'>"+data+"</span>";
								}
								else if (data >= 300 && data < 400) {
									return "<span class='badge badge-pills badge-soft-warning'>"+data+"</span>";
								}
								else if (data == 0){
									// datatable throws error when no data is returned
									return "";
								}
								return `<span class='badge badge-pills badge-soft-danger'>`+data+`</span>`;
							},
							"targets": 2,
						},
						{
							"render": function ( data, type, row ) {
								if (data){
									return htmlEncode(data);
								}
								return "";
							},
							"targets": 3,
						},
						{
						"render": function ( data, type, row ) {
							if (data) {
								data = data.reverse();
								var html_treeview = '';
								if (data.length > 1) {
									// has been scanned multiple times
									html_treeview += `<p class="text-dark">Directory Scan has been performed ${data.length} times.</p>`;
								}
								html_treeview += `<ul class="list-unstyled">`;
								var item_pos = 0;
								data.forEach(function(item){
									var aria_expanded = 'false';
									var show = '';
									if (item_pos == 0) {
										aria_expanded = 'true';
										show = 'hide';
									}
									if(item['directory_files'].length == 0){
										html_treeview += `<li class="mt-1"><span class="text-muted"><i class="fe-folder"></i> No Directories Discovered during the Scan Performed on ${item.scanned_date}</span></li>`;
										html_treeview += `<div class="ml-2 collapse ${show}" id="dir_${item.formatted_date_for_id}_${item.id}">`;
									}
									else{
										html_treeview += `<li class="mt-1"><a data-bs-toggle="collapse" href="#dir_${item.formatted_date_for_id}_${item.id}" aria-expanded="${aria_expanded}" aria-controls="dir_${item.formatted_date_for_id}_${item.id}"><i class="fe-folder-plus"></i> <span class="me-1 badge badge-soft-primary badge-link bs-tooltip" title="Directories">${item['directory_files'].length} <i class="far fa-folder"></i></span> found on ${item.scanned_date}</a></li>`;
										html_treeview += `<div class="ml-2 collapse ${show}" id="dir_${item.formatted_date_for_id}_${item.id}">`;
										var interesting_badge = '';
										// console.log(item['directory_files'][i]['name']);
										item['directory_files'].forEach(function(file){
											interesting_keywords_array.forEach(function(keyword){
												if (file.name.includes(keyword)) {
													interesting_badge = '<span class="badge badge-soft-danger ms-1 me-1" data-toggle="tooltip" data-placement="top" title="Interesting Directory">Interesting</span>';
													return;
												}
											});
											// console.log(file);
											var http_status_badge = '';
											if (file.http_status >= 200 && file.http_status < 300) {
												http_status_badge = `<span class='badge badge-pills badge-soft-success' data-toggle="tooltip" data-placement="top" title="HTTP Status">`+file.http_status+`</span>`;
											}
											else if (file.http_status >= 300 && file.http_status < 400) {
												http_status_badge = `<span class='badge badge-pills badge-soft-warning' data-toggle="tooltip" data-placement="top" title="HTTP Status">`+file.http_status+`</span>`;
											}
											else{
												http_status_badge = `<span class='badge badge-pills badge-soft-danger' data-toggle="tooltip" data-placement="top" title="HTTP Status">`+file.http_status+`</span>`;
											}
											var http_url = file.url;
											var lines_word_content = '';
											if (file.lines) {
												lines_word_content += `${file.lines} Lines`;
											}
											if (file.words) {
												lines_word_content += ` ${file.words} Words`
											}
											var lines_word_badge = ''
											if (lines_word_content.length > 1) {
												lines_word_badge = `<span class="badge badge-soft-secondary" data-toggle="tooltip" data-placement="top" title="Response Content Status">${lines_word_content}</span>`;
											}
											html_treeview += `<li class="mt-1"><a href="` + htmlEncode(http_url) + `" target="_blank">` + htmlEncode(atob(file.name)) + ` (` + file.length / 100 + ` Kb) <span class="badge badge-soft-primary" data-toggle="tooltip" data-placement="top" title="Content Type">(` + htmlEncode(file.content_type) + `)</span> ${http_status_badge}</a>${interesting_badge} ${lines_word_badge}</li>`;
										});
									}
									item_pos++;
									html_treeview += '</div>';
								});
								html_treeview += `</ul>`;
								return html_treeview;
							}
							return '';
						},
						"targets": 4,
					},
				],
				"dom": "<'dt--top-section'<'row'<'col-12 mb-3 mb-sm-0 col-sm-4 col-md-3 col-lg-4 d-flex justify-content-sm-start justify-content-center'l><'dt--pages-count col-12 col-sm-6 col-md-4 col-lg-4 d-flex justify-content-sm-middle justify-content-center'i><'dt--pagination col-12 col-sm-2 col-md-5 col-lg-4 d-flex justify-content-sm-end justify-content-center'p>>>" +
				"<'table-responsive'tr>" +
				"<'dt--bottom-section'<'row'<'col-12 mb-3 mb-sm-0 col-sm-4 col-md-3 col-lg-4 d-flex justify-content-sm-start justify-content-center'l><'dt--pages-count col-12 col-sm-6 col-md-4 col-lg-4 d-flex justify-content-sm-middle justify-content-center'i><'dt--pagination col-12 col-sm-2 col-md-5 col-lg-4 d-flex justify-content-sm-end justify-content-center'p>>>",
				drawCallback: function () {
				},
				preDrawCallback: function () {
					return fetch("/api/listInterestingKeywords")
					.then(response => {
						return response.json();
					})
					.then(data => {
						interesting_keywords_array = data;
					});
				},
				initComplete: function( settings, json ) {
				},
				'createdRow': function( row, data, dataIndex ) {
					if (data['is_important']){
						$(row).addClass('table-danger');
					}
				},
				"rowCallback": function( row, data, index ) {
					// console.log(data);
					// var data = JSON.parse(data['directories']);
					// if (!data['results'].length) {
					// 	$(row).hide();
					// }
				},
			});
		});
	{% endif %}

	{% if 'screenshot' in history.tasks %}
		$("#pills-screenshot-tab").click(function() {
			if($('#screenshots-table').children().length > 0) {
				return false;
			}
			get_screenshot({{scan_history_id}});

			//animate search placeholder
			const words = ["Search by Page Title   ",
			"Search by HTTP Status   ",
			"Search 'Interesting'   ",
			"Search by Subdomain Name   "]

			typingEffect(words, "screenshot-search", 0);
		});
	{% endif %}

	//populate widgets
	get_important_subdomains(target_id=null, scan_history_id={{scan_history_id}});
	get_recon_notes(target_id=null, scan_history_id={{scan_history_id}});

	get_ips(scan_id={{scan_history_id}}, domain_id=null);
	get_technologies(scan_id={{scan_history_id}}, domain_id=null);
	get_ports(scan_id={{scan_history_id}}, domain_id=null);

	get_subdomain_changes({{scan_history_id}});
	get_endpoint_changes({{scan_history_id}});

	get_interesting_subdomains(project='{{current_project.slug}}', null, {{scan_history_id}});
	get_interesting_endpoints(project='{{current_project.slug}}', null, {{scan_history_id}});

	loadSubscanHistoryWidget(scan_history_id={{scan_history_id}}, domain_id=null);

	get_most_vulnerable_target(slug='{{current_project.slug}}', scan_id={{scan_history_id}}, target_id=null, ignore_info=false);
	// listener for info checkbox on most vulnerable target
	$('#ignore_info_most_vuln_checkbox').change(function() {
		if (this.checked) {
			var text_msg = 'Informational Vulnerabilities ignored in Most Vulnerable Targets.';
		}
		else{
			var text_msg = 'Informational Vulnerabilities included in Most Vulnerable Targets.';
		}
		get_most_vulnerable_target(slug='{{current_project.slug}}', project_id={{current_project.id}}, scan_id={{scan_history_id}}, target_id=null, ignore_info=this.checked);
		Snackbar.show({
			text: text_msg,
			pos: 'top-right',
			duration: 2500
		});
	});

	get_most_common_vulnerability(slug='{{current_project.slug}}', scan_id={{scan_history_id}}, target_id=null, ignore_info=false);
	// listener for info checkbox on most vulnerable target
	$('#ignore_info_most_common_vuln_checkbox').change(function() {
		if (this.checked) {
			var text_msg = 'Informational Vulnerabilities ignored for Most Common Vulnerabilities.';
		}
		else{
			var text_msg = 'Informational Vulnerabilities included for Most Common Vulnerabilities.';
		}
		get_most_common_vulnerability(slug='{{current_project.slug}}', scan_id={{scan_history_id}}, target_id=null, ignore_info=this.checked);
		Snackbar.show({
			text: text_msg,
			pos: 'top-right',
			duration: 2500
		});
	});


	// tab click listeners
	$('#interesting-tab-btn').click(function(){
		$('.nav-tabs a[href="#interesting-tab"]').tab('show')
	});

	$('#buckets-tab-btn').click(function(){
		$('.nav-tabs a[href="#buckets-tab"]').tab('show')
	});

	$('#recon-changes-tab-btn').click(function(){
		$('.nav-tabs a[href="#recon-changes-tab"]').tab('show')
	});

	$("#pills-osint-tab").click(function() {
		get_metadata({{scan_history_id}});
		get_emails({{scan_history_id}});
		get_employees({{scan_history_id}});
		get_dorks({{scan_history_id}});
	});

	$("#pills-visualisation-tab").click(function() {
		if($('#visualisation').children().length > 0) {
			return false;
		}
		visualise_scan_results({{scan_history_id}});
	});

	$("#pills-endpoints-tab").click(function() {
		get_endpoints(project='{{current_project.slug}}', scan_history={{scan_history_id}}, null, gf_tags=null);
	});

	{% if 'fetch_url' in history.tasks and history.used_gf_patterns %}
		{% for pattern in history.used_gf_patterns|split:"," %}
			$("#pills-{{pattern}}-tab").click(function() {
				get_endpoints(project='{{current_project.slug}}', scan_history={{scan_history_id}}, domain_id=null, gf_tags='{{pattern}}');
			});
		{% endfor %}
	{% endif %}

	$("#pills-subdomain-tab").click(function() {
		// prevent table loading twice
		// https://datatables.net/manual/tech-notes/3
		if ( $.fn.dataTable.isDataTable( '#subdomain_scan_results' ) ) {
			return false;
		}
		var subdomain_ajax_url = '/api/listDatatableSubdomain/?project={{current_project.slug}}&scan_id={{scan_history_id}}&format=datatables';
		var is_subd_grouping = false;
		var subd_grouping_col = 8;
		var subdomain_datatables = $('#subdomain_scan_results').DataTable({
			"headerCallback": function(e, a, t, n, s) {
				e.getElementsByTagName("th")[0].innerHTML='<div class="form-check ms-1 form-check-primary"><input type="checkbox" class="float-start form-check-input chk-parent" id="head_checkbox" onclick=mainCheckBoxSelected(this)>\n<span class="new-control-indicator"></span><span style="visibility:hidden">c</span></div>\n'
			},
			"destroy": true,
			"processing": true,
			"oLanguage": subdomain_oLanguage,
			"fnCreatedRow": function (nRow, aData, iDataIndex) {
				$(nRow).attr('id', 'subdomain_row_' + aData['id']);
			},
			"stripeClasses": [],
			"lengthMenu": subdomain_datatable_length_menu,
			"pageLength": subdomain_datatable_page_length,
			'serverSide': true,
			"ajax": {
					'url': subdomain_ajax_url,
			},
			"rowGroup": {
				"startRender": function(rows, group) {
					return group + ' (' + rows.count() + ' Subdomains)';
				}
			},
			"order": [[ 8, "desc" ]],
			"columns": subdomain_datatable_columns,
			"columnDefs": [
				{ "orderable": false, "targets": [2, 3, 6, 7, 9]},
				{
					"targets": [ 2, 3, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 25, 26, 27, 28],
					"visible": false,
					"searchable": false,
				},
				{
					"targets": [ 11, 13, 21, 22, 23 ],
					"visible": false,
					"searchable": true,
				},
				{"className": "text-center", "targets": [2, 3, 4, 8, 10]},
				// checkbox
				{
					"targets":0, "width":"20px", "className":"", "orderable":!1, render:function(e, a, t, n) {
						return'<div class="form-check ms-1 form-check-primary"><input type="checkbox" name="subdomain_checkbox['+ e + ']" class="float-start form-check-input subdomain_checkbox" value="' + e + '" onchange=toggleMultipleSubdomainButton()>\n<span class="new-control-indicator"></span><span style="visibility:hidden">c</span></div>';
					}},
					// subdomain Name
					{
						"render": function ( data, type, row ) {
							var badges = '';
							var tech_badge = '';
							var interesting_badge = '';
							var content_type = '';
							var web_server = '';
							var waf_badge = '';
							if (row['technologies']){
								tech_badge = '<div>' + parse_technology(row['technologies'], "primary", scan_id={{scan_history_id}}, domain_id=null) + '</div>';
							}
							if(row['is_interesting'])
							{
								interesting_badge = `<div><span class='me-1 badge badge-soft-danger' data-toggle="tooltip" data-placement="top" title="Interesting Subdomain">Interesting</span></div>`;
							}

							if (row['content_type']) {
								content_type = `<div><span class='mt-1 badge badge-soft-blue bs-tooltip' title="Content Type">${row['content_type']}</span></div>`;
							}

							if (row['webserver']) {
								web_server = `<div><span class='mt-1 badge badge-soft-info bs-tooltip' title="Web Server">${row['webserver']}</span></div>`;
							}

							if (interesting_badge) {
								badges =   interesting_badge;
							}

							todo_icon = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#e7515a" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>`;
							todo_badge = '';

							if (row['todos_count']) {
								todo_badge = `<span class="text-danger badge badge-link badge-soft-danger float-end mt-1" onclick="list_subdomain_todos(${row['id']}, '${row['name']}')">${todo_icon}&nbsp;${row['todos_count']} Todos&nbsp;</span>`
							}

							endpoint_count_badge = '';
							if (row['endpoint_count']) {
								endpoint_count_badge = `<span class="pl-2 pr-2 me-1 badge badge-soft-primary badge-link bs-tooltip" title="Endpoints" onclick="get_endpoint_modal('{{current_project.slug}}', {{history.id}}, ${row['id']}, '${row['name']}')">${row['endpoint_count']} <i class=" fas fa-link"></i></span>`;
							}

							if(row['waf'].length){
								waf_badge = `<div><span class="pl-2 pr-2 my-1 badge badge-soft-danger" bs-tooltip" title="WAF Detected by wafw00f!""><i class="fe-cloud-lightning mx-1"></i>WAF Detected</span>`;
								for (var waf in row['waf']) {
									var waf_object = row['waf'][waf];
									waf_badge += `<span class="mx-1 my-1 badge badge-soft-danger" bs-tooltip" title="WAF Manufacturer: ${waf_object.manufacturer}">${waf_object.name}</span>`;
								}
								waf_badge += `</div>`;
							}

							vuln_count_badge = '';
							total_vuln_badge = `<span class='pl-2 pr-2 me-1 mt-1 badge badge-critical bs-tooltip badge-link' title="All Vulnerabilities" onclick="get_vulnerability_modal(scan_id={{history.id}}, severity=null, subdomain_id=${row['id']}, subdomain_name='${row['name']}')">${row['info_count'] + row['low_count'] + row['high_count'] + row['medium_count'] + row['critical_count']} <i class="fas fa-bug"></i></span>`;
							info_badge = `<span class='pl-2 pr-2 me-1 mt-1 badge badge-soft-info bs-tooltip badge-link' title="Informational Vulnerabilities" onclick="get_vulnerability_modal(scan_id={{history.id}}, severity=0, subdomain_id=${row['id']}, subdomain_name='${row['name']}')">${row['info_count']} Info</span>`;
							low_badge = `<span class='pl-2 pr-2 me-1 mt-1 badge badge-low bs-tooltip badge-link' title=" Low Severity Vulnerabilities" onclick="get_vulnerability_modal(scan_id={{history.id}}, severity=1, subdomain_id=${row['id']}, subdomain_name='${row['name']}')">${row['low_count']} Low</span>`;
							medium_badge = `<span class='pl-2 pr-2 me-1 mt-1 badge badge-soft-warning bs-tooltip badge-link' title="Medium Severity Vulnerabilities" onclick="get_vulnerability_modal(scan_id={{history.id}}, severity=2, subdomain_id=${row['id']}, subdomain_name='${row['name']}')">${row['medium_count']} Med</span>`;
							high_badge = `<span class='pl-2 pr-2 me-1 mt-1 badge badge-soft-danger bs-tooltip badge-link' title="High Severity Vulnerabilities" onclick="get_vulnerability_modal(scan_id={{history.id}}, severity=3, subdomain_id=${row['id']}, subdomain_name='${row['name']}')">${row['high_count']} High</span>`;
							critical_badge = `<span class='pl-2 pr-2 me-1 mt-1 badge badge-critical bs-tooltip badge-link' title="Critical Vulnerabilities" onclick="get_vulnerability_modal(scan_id={{history.id}}, severity=4, subdomain_id=${row['id']}, subdomain_name='${row['name']}')">${row['critical_count']} Critical</span>`;
							vuln_count_badge = `<div class="">` + (row['info_count'] > 0? info_badge : '') + (row['low_count'] > 0? low_badge : '') + (row['medium_count'] > 0? medium_badge : '') + (row['high_count'] > 0? high_badge : '') + (row['critical_count'] > 0? critical_badge : '') + `</div>`;

							vuln_count_badge = (row['info_count'] + row['low_count'] + row['high_count'] + row['medium_count'] + row['critical_count'] > 0? total_vuln_badge : '') + vuln_count_badge;

							copy_icon = `
							<a href="javascript:;" data-clipboard-action="copy" class="action-icon copyable" data-toggle="tooltip" data-placement="top" title="Copy Subdomain!" data-clipboard-target="#subdomain-${row['id']}" id="#subdomain-${row['id']}" onclick="setTooltip(this.id, 'Copied!')"> <i class="text-primary mdi mdi-content-copy"></i></a>
							`;

							var directory_count_badge = '';
							if (row['directories_count']){
								directory_count_badge = `<span class="me-1 badge badge-soft-primary badge-link bs-tooltip" title="Directories" onclick="get_directory_modal(scan_id={{history.id}}, subdomain_id=${row['id']}, subdomain_name='${row['name']}')">${row['directories_count']} <i class="far fa-folder"></i></span>`;
							}

							var subscan_count_badge = '';
							if (row['subscan_count']){
								subscan_count_badge = `<span class="badge me-1 badge-soft-blue badge-link bs-tooltip" title="SubScans" onclick="get_and_render_subscan_history(${row['id']}, '${row['name']}')">${row['subscan_count']} <i class="fas fa-history"></i></span>`;
							}

							tech_badge += content_type;
							tech_badge += web_server;

							end_vuln_badge = '<div class="">' + subscan_count_badge + endpoint_count_badge + directory_count_badge + vuln_count_badge + '</div>';

							if (row['http_url']) {
								if (row['cname']) {
									cname_badge = `<div><span class="text-dark">CNAME<br><span class="text-warning"> ❯ </span>` + row['cname'].replace(',', '<br><span class="text-warning"> ❯ </span>') + `</div>`;
									return badges + `<div class="clipboard copy-txt"><a href="`+row['http_url']+`" class="text-primary" target="_blank"><span id='subdomain-${row['id']}'>` + data  +`${copy_icon} </span></a>`+ `</div>` + cname_badge + waf_badge  + end_vuln_badge + tech_badge + todo_badge;
								}
								return badges + `<div class="clipboard copy-txt"><a href="`+row['http_url']+`" class="text-primary" target="_blank"><span id='subdomain-${row['id']}'>` + data + `${copy_icon} </span></a>` + `</div>` + waf_badge + end_vuln_badge + tech_badge + todo_badge;
							}
							return badges + `<div class="clipboard copy-txt"><a href="https://`+data+`" class="text-primary" target="_blank"><span id='subdomain-${row['id']}'>` + data + `${copy_icon} </span></a>` + `</div>` + waf_badge + end_vuln_badge + tech_badge + todo_badge;
						},
						"targets": 1
					},
					// http_status
					{
						"render": function ( data, type, row ) {
							// display badge based on http status
							// green for http status 2XX, orange for 3XX and warning for everything else
							if (data >= 200 && data < 300) {
								return "<span class='badge bg-success'>"+data+"</span>";
							}
							else if (data >= 300 && data < 400) {
								return "<span class='badge bg-warning'>"+data+"</span>";
							}
							else if (data == 0){
								// datatable throws error when no data is returned
								return "";
							}
							return `<span class='badge bg-danger'>`+data+`</span>`;
						},
						"targets": 4,
					},
					// page title
					{
						"render": function ( data, type, row ) {
							if (data){
								return htmlEncode(data);
							}
							return "";
						},
						"targets": 5,
					},
					// ip address
					{
						"render": function ( data, type, row ) {
							ip_badge = ''
							if (data)
							{
								Object.entries(data).forEach(([key, value]) => {
									if (value['is_cdn']) {
										ip_badge += `<span class='m-1 badge badge-soft-warning badge-link' title="CDN IP Address" onclick="get_ip_details('${value.address}', {{scan_history_id}})">${value.address}</span>`
									}
									else{
										ip_badge += `<span class='m-1 badge badge-soft-primary badge-link' onclick="get_ip_details('${value.address}', {{scan_history_id}})">${value.address}</span>`
									}
								});
								return ip_badge;
							}
							return "";
						},
						"targets": 6,
					},
					// open ports
					{
						"render": function ( data, type, row ) {
							port_badge = ''
							if (data){
								for (ip in data){
									ports = data[ip]['ports']
									for (port in ports){
										port_obj = data[ip]['ports'][port]
										badge_color = port_obj['is_uncommon'] ? 'danger' : 'primary';
										title = port_obj['is_uncommon'] ? 'Uncommon Port - ' + port_obj['description'] : port_obj['description'];
										port_badge += `<span class='m-1 badge badge-soft-${badge_color} bs-tooltip badge-link' title='${title}' onclick="get_port_details(${port_obj['number']}, {{scan_history_id}})">${port_obj['number']}/${port_obj['service_name']}</span>`
									}
								}
								return port_badge;
							}
							return "";
						},
						"targets": 7,
					},
					{
						"render": function ( data, type, row ) {
							if (data){
								//return lightbox with caption as http link
								return data;
							}
							return 0;
						},
						"targets": 8,
					},
					// screenshot
					{
						"render": function ( data, type, row ) {
							if (data){
								//return lightbox with caption as http link
								return `<a href="/media/`+data+`" data-lightbox="screenshots" data-title="&lt;a target='_blank' href='`+row['http_url']+`'&gt;&lt;h3 style=&quot;color:white&quot;&gt;`+row['name']+`&lt;/h3&gt;&lt;/a&gt;"><img src="/media/`+data+`" class="img-fluid rounded mb-4 mt-4 screenshot" onerror="removeImageElement(this)"></a>`;
							}
							return "";
						},
						"targets": 9,
					},
					// response_time
					{
						"render": function ( data, type, row ) {
							if (data){
								return get_response_time_text(data);
							}
							return "";
						},
						"targets": 10,
					},
					// Action
					{
						"render": function ( data, type, row ) {
							const cms_detector_http_url = row['http_url'] ? row['http_url'] : 'https://' + row['name'];
							return `
							<div class="btn-group mt-2">
							<button type="button" data-toggle="tooltip" data-placement="top" title="Show Attack Surface" class="btn btn-primary me-1 bs-tooltip" onclick="show_attack_surface_modal(${row['id']})"><i class="fe-eye"></i></button>
							<button type="button" data-toggle="tooltip" data-placement="top" title="Further Scan Subdomain" class="btn btn-primary btn-scan-subdomain me-1" id="${row['id']}"><i class="fe-zap"></i></button>
							<button type="button" data-toggle="tooltip" data-placement="top" title="Add Recon Todo/Note" class="btn btn-primary me-1" id="${row['id']}" onclick="add_note_for_subdomain(${row['id']}, '${row['name']}')"><i class="fe-file-plus"></i></button>
							<button class="btn btn-primary me-1 dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></button>
							<div class="dropdown-menu dropdown-menu-end">
							<a class="dropdown-item" href="#" onclick="mark_important_subdomain(this, ${row['id']})" id="${row['id']}"><i class="mdi mdi-alert-rhombus-outline me-2 text-muted font-18 vertical-middle"></i>Mark Important Subdomain</a>
							<a class="dropdown-item" href="#" onclick="detect_subdomain_cms('${cms_detector_http_url}', ${row['http_status']})"><i class="fe-grid me-2 text-muted font-18 vertical-middle"></i>Detect CMS</a>
							<a class="text-danger dropdown-item btn-delete-subdomain" href="#" id="${row['id']}"><i class="text-danger mdi mdi-delete-forever-outline me-2 font-18 vertical-middle"></i>Delete Subdomain</a>
							</div>
							</div>
							`;
						},
						"targets": 24,
					},
				],
				"dom": "<'dt--top-section'<'row'<'col-12 mb-3 mb-sm-0 col-sm-4 col-md-3 col-lg-4 d-flex justify-content-sm-start justify-content-center'l><'dt--pages-count col-12 col-sm-6 col-md-4 col-lg-4 d-flex justify-content-sm-middle justify-content-center'i><'dt--pagination col-12 col-sm-2 col-md-5 col-lg-4 d-flex justify-content-sm-end justify-content-center'p>>>" +
				"<'table-responsive'tr>" +
				"<'dt--bottom-section'<'row'<'col-12 mb-3 mb-sm-0 col-sm-4 col-md-3 col-lg-4 d-flex justify-content-sm-start justify-content-center'l><'dt--pages-count col-12 col-sm-6 col-md-4 col-lg-4 d-flex justify-content-sm-middle justify-content-center'i><'dt--pagination col-12 col-sm-2 col-md-5 col-lg-4 d-flex justify-content-sm-end justify-content-center'p>>>",
				"initComplete": function(settings, json) {
					api = this.api();
					subdomain_datatable_col_visibility(subdomain_datatables);
					$(".dtrg-group th:contains('No group')").remove();
				},
				"drawCallback": function () {
					$('.badge').tooltip({ template: '<div class="tooltip status" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>' })
					$('.bs-tooltip').tooltip();
					$('.dtrg-group').remove();
					drawCallback_api = this.api();
					setTimeout(function() {
						$(".dtrg-group th:contains('No group')").remove();
					}, 1);
				},
				"rowCallback": function( row, data, dataIndex ) {
					if (data['is_important']){
						$(row).addClass('table-danger');
					}
				},
			});

			var radioGroup = document.getElementsByName('grouping_subd_row');
			radioGroup.forEach(function(radioButton) {
				radioButton.addEventListener('change', function() {
					if (this.checked) {
						var groupRows = document.querySelectorAll('tr.group');
						var col_index = get_datatable_col_index(this.value, subdomain_datatable_columns);
						api.page.len(-1).draw();
						api.order([col_index, 'asc']).draw();
						subdomain_datatables.rowGroup().dataSrc(this.value);
						Snackbar.show({
							text: 'Subdomains grouped by ' + this.value,
							pos: 'top-right',
							duration: 2500
						});
					}
				});
			});

			$('#reload_subdomain_table_btn').click(function () {
				subdomain_datatables.ajax.reload();
			});

			$('#subdomain-search-button').click(function () {
				subdomain_datatables.search($("#subdomains-search").val()).draw() ;
			});

			$('#load_important_subdomain_table_btn').click(function() {
				subdomain_datatables.search('is_important=true').draw();
			});

			$('input[name=sub_http_status_filter_checkbox]').change(function() {
				if ($(this).is(':checked')) {
					subdomain_datatables.column(4).visible(true);
				} else {
					subdomain_datatables.column(4).visible(false);
				}
				window.localStorage.setItem('sub_http_status_filter_checkbox', $(this).is(':checked'));
			});

			$('input[name=sub_page_title_filter_checkbox]').change(function() {
				if ($(this).is(':checked')) {
					subdomain_datatables.column(5).visible(true);
				} else {
					subdomain_datatables.column(5).visible(false);
				}
				window.localStorage.setItem('sub_page_title_filter_checkbox', $(this).is(':checked'));
			});
			$('input[name=sub_ip_filter_checkbox]').change(function() {
				if ($(this).is(':checked')) {
					subdomain_datatables.column(6).visible(true);
				} else {
					subdomain_datatables.column(6).visible(false);
				}
				window.localStorage.setItem('sub_ip_filter_checkbox', $(this).is(':checked'));
			});
			$('input[name=sub_ports_filter_checkbox]').change(function() {
				if ($(this).is(':checked')) {
					subdomain_datatables.column(7).visible(true);
				} else {
					subdomain_datatables.column(7).visible(false);
				}
				window.localStorage.setItem('sub_ports_filter_checkbox', $(this).is(':checked'));
			});
			$('input[name=sub_content_length_filter_checkbox]').change(function() {
				if ($(this).is(':checked')) {
					subdomain_datatables.column(8).visible(true);
				} else {
					subdomain_datatables.column(8).visible(false);
				}
				window.localStorage.setItem('sub_content_length_filter_checkbox', $(this).is(':checked'));
			});
			$('input[name=sub_response_time_filter_checkbox]').change(function() {
				if ($(this).is(':checked')) {
					subdomain_datatables.column(10).visible(true);
				} else {
					subdomain_datatables.column(10).visible(false);
				}
				window.localStorage.setItem('sub_response_time_filter_checkbox', $(this).is(':checked'));
			});
			$('input[name=sub_screenshot_filter_checkbox]').change(function() {
				if ($(this).is(':checked')) {
					subdomain_datatables.column(9).visible(true);
				} else {
					subdomain_datatables.column(9).visible(false);
				}
				window.localStorage.setItem('sub_screenshot_filter_checkbox', $(this).is(':checked'));
			});

			$("#subdomain_scan_results").on('click', '.btn-delete-subdomain', function () {
				var subdomain_id = $(this).attr('id');
				var data = {'subdomain_ids': [subdomain_id]};
				var row = this;
				Swal.fire({
					showCancelButton: true,
					title: 'Delete Subdomain!',
					text: 'Do you really want to delete this subdomain? This action cannot be undone.',
					icon: 'error',
					confirmButtonText: 'Delete',
				}).then((result) => {
					if (result.isConfirmed) {
						Swal.fire({
							title: 'Deleting Subdomain...',
							allowOutsideClick: false
						});
						swal.showLoading();
						fetch('/api/action/subdomain/delete/', {
							method: 'POST',
							credentials: "same-origin",
							headers: {
								"X-CSRFToken": getCookie("csrftoken"),
								'Content-Type': 'application/json'
							},
							body: JSON.stringify(data)
						})
						.then(response => response.json())
						.then(function (response) {
							swal.close();
							if (response['status']) {
								$(row).parent().parent().parent().parent().remove();
								Snackbar.show({
									text: 'Subdomain successfully deleted!',
									pos: 'top-right',
									duration: 2500
								});
							}
							else{
								Swal.fire({
									title:  'Could not delete Subdomain!',
									icon: 'error',
								});
							}
						});
					}
				});;
				$('a[data-toggle="tooltip"]').tooltip("hide")
			});

			$("#subdomain_scan_results").on('click', '.btn-scan-subdomain', function () {
				$('input[type=checkbox]').prop('checked',false);
				$('#subscan-modal').modal('show');
				var subdomain_id = $(this).attr('id');
				$('a[data-toggle="tooltip"]').tooltip("hide")
				$('#subtask_subdomain_id').val(subdomain_id);
				// to distinguish multiple subscan or single, put a extra attribute on button
				$('#btn-initiate-subtask').attr('multiple-subscan', false);
			});

			// if port scanning is not done, remove port row
			var column = subdomain_datatables.column('7');
			{% if 'port_scan' in history.tasks %}
			column.visible(true);
			{% else %}
			column.visible(false);
			{% endif %}
			// if screenshot is not taken remove screenshot row
			var column = subdomain_datatables.column('9');
			{% if 'screenshot' in history.tasks %}
			column.visible(true);
			{% else %}
			column.visible(false);
			{% endif %}
		});

	// filters for checkbox
	var filter_cols = [
		'sub_http_status_filter_checkbox',
		'sub_page_title_filter_checkbox',
		'sub_ip_filter_checkbox',
		'sub_ports_filter_checkbox',
		'sub_content_length_filter_checkbox',
		'sub_response_time_filter_checkbox',
		'sub_screenshot_filter_checkbox',
		'vuln_source_checkbox',
		'vuln_severity_checkbox',
		'vuln_vulnerable_url_checkbox',
		'vuln_status_checkbox',
		'end_http_status_filter_checkbox',
		'end_page_title_filter_checkbox',
		'end_tags_filter_checkbox',
		'end_content_type_filter_checkbox',
		'end_content_length_filter_checkbox',
		'end_response_time_filter_checkbox',
	];

	for (var col in filter_cols) {
		if(window.localStorage.getItem(filter_cols[col]) != null && window.localStorage.getItem(filter_cols[col]) === 'false'){
			$('#' + filter_cols[col]).prop('checked', false);
		}
	}

	var countriesData = {
		{% for country in asset_countries %}
			"{{country.iso}}": {{country.count}},
		{% endfor %}
	};

	$('#world_map').vectorMap({
		map: 'world_mill_en',
		hoverOpacity: 0.7,
		hoverColor: false,
		regionStyle: {
				initial: {
					fill: '#d4dadd'
				}
			},
		backgroundColor: 'transparent',
		series: {
			regions: [{
				values: countriesData,
				scale: [
					{% for country in asset_countries %}
						shadeColor('#2C3E50', {{country.count}}),
					{% endfor %}
				],
				normalizeFunction: 'polynomial'
			}]
		},
		onRegionTipShow: function(e, el, code){
			if (code in countriesData) {
				el.html(el.html()+' (Total Assets : '+ countriesData[code]+')');
			}
			else{
				el.html(el.html()+' (Total Assets : 0)');
			}
		}
	});

	// s3buckets datatable
	var s3_table = $('#s3-datatable').DataTable({
		"order": [[0, 'asc']],
		"dom": "<'dt--top-section'<'row'<'col-12 mb-3 mb-sm-0 col-sm-4 col-md-3 col-lg-4 d-flex justify-content-sm-start justify-content-center'l><'dt--pages-count col-12 col-sm-6 col-md-4 col-lg-4 d-flex justify-content-sm-middle justify-content-center'i><'dt--pagination col-12 col-sm-2 col-md-5 col-lg-4 d-flex justify-content-sm-end justify-content-center'p>>>" +
			"<'table-responsive'tr>" +
			"<'dt--bottom-section'<'row'<'col-12 mb-3 mb-sm-0 col-sm-4 col-md-3 col-lg-4 d-flex justify-content-sm-start justify-content-center'l><'dt--pages-count col-12 col-sm-6 col-md-4 col-lg-4 d-flex justify-content-sm-middle justify-content-center'i><'dt--pagination col-12 col-sm-2 col-md-5 col-lg-4 d-flex justify-content-sm-end justify-content-center'p>>>",
		"oLanguage": {
			"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
			"sInfo": "Showing page _PAGE_ of _PAGES_",
			"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
			"sSearchPlaceholder": "Search...",
			"sLengthMenu": "Results :  _MENU_",
		},
		"stripeClasses": [],
		"lengthMenu": [[50, 100, 200, 300, 400, -1], [50, 100, 200, 300, 400, 'All']],
		"pageLength": 50,
	});

});
</script>
{% endblock page_level_script %}
